[nem-en] strange error message from ncc
Kamil Skalski
kamil.skalski at gmail.com
Sat Jan 14 21:51:01 CET 2006
> class Program
> {
> static Main (args : array [string]) : void
> {
> //Console.WriteLine("Hello");
> while(true) {
> }
> //when(true) {
> //}
> if(true) {
> } else {
> }
> }
> }
> }
>
> Program.n(20,7): Warning: this expression has been skipped in code
> generation due to throw usage
This is not the best message possible, but it is more or less correct.
It means that 'if ...' part was skipped, because compiler detected the
infinite loop in code preceding it. Simply the part 'due to throw
usage' is wrong - it was placed here because such cases (unreachable
code) ocur mainly in code throwing exceptions in all branches:
if (bla)
throw E();
else {
...
throw B()
}
Maybe is would be enough to change the message to 'due to unreachable
code'. Michal, what do you think?
> Program.n(20,7): Warning: (() :> void)
It looks like some garbage message occuring in consequence of previous
ones. But if it occurs by itself in some sane code, then it should be
reported as a bug.
>
> but only if while(true) {} is not commented out...
>
Exactly, because this loop makes the rest of the code pointless ;)
--
Kamil Skalski
http://nazgul.omega.pl
More information about the devel-en
mailing list