I am just wondering if these code blocks gets compiled into .dll
I don't think this one gets compiled at all
#if SOMETHING_UNDEFINED
// some code - this is ignored by the compiler
#endif
Now what about these?
1.
if(false) {
// some code - is this compiled?
}
2.
const bool F = false;
if(F) {
// some code - is this compiled?
}
3.
bool F = false;
if(F) {
// some code - is this compiled?
}
EDIT: Sorry, I was talking about Visual Studio
Just testing it, the Microsoft C# 4 compiler doesn't, and it looks like the Mono gmcs compiler version 2.4.0.0 doesn't either. I don't know that there's anything in the spec prohibiting it though.
EDIT: When I answered this, only the first version was present. Case 2 is equivalent to case 1, but case 3 isn't.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With