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;
    }
}
bright
  • 4,700
  • 1
  • 34
  • 59

0 Answers0