Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / tests / gtest-iter-16.cs
1 using System.Collections.Generic;
2
3 namespace Test
4 {
5         public abstract class Base
6         {
7                 public virtual IEnumerable<Base> GetStuff (int a)
8                 {
9                         yield return this;
10                 }
11         }
12
13         public abstract class Derived : Base
14         {
15                 public override IEnumerable<Base> GetStuff (int a)
16                 {
17                         foreach (var x in base.GetStuff (a))
18                                 yield return x;
19                 }
20         }
21
22         public class SpecialDerived : Derived
23         {
24                 public override IEnumerable<Base> GetStuff (int a)
25                 {
26                         foreach (var x in base.GetStuff (a))
27                                 yield return x;
28                 }
29
30                 public static void Main ()
31                 {
32                         Base b = new SpecialDerived ();
33                         foreach (var a in b.GetStuff (5)) {
34                         }
35                 }
36         }
37 }