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

38 lines
620 B
C#

using System.Collections.Generic;
namespace Test
{
public abstract class Base
{
public virtual IEnumerable<Base> GetStuff (int a)
{
yield return this;
}
}
public abstract class Derived : Base
{
public override IEnumerable<Base> GetStuff (int a)
{
foreach (var x in base.GetStuff (a))
yield return x;
}
}
public class SpecialDerived : Derived
{
public override IEnumerable<Base> GetStuff (int a)
{
foreach (var x in base.GetStuff (a))
yield return x;
}
public static void Main ()
{
Base b = new SpecialDerived ();
foreach (var a in b.GetStuff (5)) {
}
}
}
}