In Vulcan adding this statement at the end of a method or function prevents the debugger to step through the lines ofthat code:
[System.Diagnostics.DebuggerHidden()];
(It is one of the items on my list of drawbacks VS versus VO where you can just set an attribute to a method for that which is a lot clearer)
However in X# it gives the error XS0162 Unreachable code detected
What should I do differently?
I tried it without () ( as in C#) and without ; (which gives a parser error) so I am not sure how it was changed in X#?
Dick
[System.Diagnostics.DebuggerHidden()]; unreachable?
[System.Diagnostics.DebuggerHidden()]; unreachable?
Wouldn't that has to be placed in front of the method?
Karl
Karl
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
[System.Diagnostics.DebuggerHidden()]; unreachable?
Hello Karl,
Yes you are right, I mixed 2 methods up. But the question remains unchanged...
Dick
Yes you are right, I mixed 2 methods up. But the question remains unchanged...
Dick
[System.Diagnostics.DebuggerHidden()]; unreachable?
Hi Dick,
That warning most probably refers to other part of the code, for example something like
so in this case the compiler realizes that the last RETURN statement will never execute. I suspect it will be something similar, but if it is not clear, can you please show us the code?
Chris
That warning most probably refers to other part of the code, for example something like
Code: Select all
Function Something(l AS LOGIC) AS INT
IF l
RETURN 1
ELSE
RETURN 2
ENDIF
RETURN 0
Chris
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
[System.Diagnostics.DebuggerHidden()]; unreachable?
Hello Chris,
It looks like it works with and without parenthesizes, correct?
[System.Diagnostics.DebuggerHidden()];
and
[System.Diagnostics.DebuggerHidden];
Dick
Smart and your are absolutely right. I should have seen that the error pointed to the line above it - hence my mix up with "start" and "end" of the method.That warning most probably refers to other part of the code
It looks like it works with and without parenthesizes, correct?
[System.Diagnostics.DebuggerHidden()];
and
[System.Diagnostics.DebuggerHidden];
Dick
[System.Diagnostics.DebuggerHidden()]; unreachable?
Hi Dick,
Yeah, you can use either versions. In some attributes you can use parameters and in this case you'd need the syntax with the parentheses, for example:
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
But for the parameterless attributes, also the "cleaner" syntax without parens is provided as well.
Chris
Yeah, you can use either versions. In some attributes you can use parameters and in this case you'd need the syntax with the parentheses, for example:
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
But for the parameterless attributes, also the "cleaner" syntax without parens is provided as well.
Chris
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu