Bug in Mono C# compiler's implementation of yield? [closed]
Asked Answered
E

0

12

This code causes an internal compiler error at the if(false) statement, using the 2.10.8 dmcs as well as MonoTouch. Is this known? (This may be a bug report, but I could be doing something lame.)

using System;
using System.Collections;
class X
{
    static int Main()
    {
       foreach(var i in GetAll())
       {
       }

       return 0;
    }
    static IEnumerable GetAll()
    {
       yield return 1;
       if (false)
          yield return 2;
    }
}
Emotionalize answered 20/2, 2012 at 20:21 Comment(6)
Internal compiler errors are always compiler bugs IMO.Turpitude
Please fill a bug report at bugzilla.xamarin.comValvule
I can see how this went undiagnosed for so long.Lippold
@poupou, if you or someone else has a bugzilla account, could you please do the needful? I want to avoid yet another conduit for email spam - and bugzilla makes plain that email addresses are not kept private.Emotionalize
filled as bugzilla.xamarin.com/show_bug.cgi?id=3553Valvule
Bug is now marked fixed.Dutiful

© 2022 - 2024 — McMap. All rights reserved.