[nem-en] strange error message from ncc

Michal Moskal michal.moskal at gmail.com
Sun Jan 15 08:43:15 CET 2006


On 1/14/06, Kamil Skalski <kamil.skalski at gmail.com> wrote:
> >   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?

Maybe just ''possibly due to throw usage''?


--
   Michal Moskal,
   http://nemerle.org/~malekith/



More information about the devel-en mailing list