Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

41 lines
590 B
C#

// CS1579: foreach statement cannot operate on variables of type `C' because it does not contain a definition for `GetEnumerator' or is inaccessible
// Line: 37
using System;
public class Enumerator
{
public bool MoveNext ()
{
return false;
}
public int Current { get; set; }
}
public class Base
{
public Enumerator GetEnumerator ()
{
return new Enumerator ();
}
}
public class C : Base
{
new internal Enumerator GetEnumerator ()
{
return new Enumerator ();
}
}
class Test
{
public static void Main ()
{
foreach (var e in new C ())
Console.WriteLine (e);
}
}