Bug in Mono C# compiler's implementation of yield?

550 Views Asked by At

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;
    }
}
0

There are 0 best solutions below