linux-packaging-mono/mcs/tests/test-iter-17.cs
Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

25 lines
558 B
C#

using System;
using System.Collections;
class Program
{
static public IEnumerable Empty {
get {
object [] os = new object [] { };
foreach (object o in os) {
yield return o;
}
}
}
public static void Main()
{
IEnumerator enumerator = Empty.GetEnumerator();
if (enumerator.Current == null)
Console.WriteLine("Successful");
enumerator.MoveNext();
if (enumerator.Current == null)
Console.WriteLine("Successful");
}
}