Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / tests / gtest-iter-03.cs
1 using System;
2 using System.Collections.Generic;
3
4 public class Test {
5
6         List<object> annotations = new List<object> ();
7
8         public IEnumerable<T> Annotations<T> () where T : class
9         {
10                 foreach (T o in Annotations (typeof (T)))
11                         yield return o;
12         }
13
14         public IEnumerable<object> Annotations (Type type)
15         {
16                 if (annotations == null)
17                         yield break;
18                 foreach (object o in annotations)
19                         if (o.GetType () == type)
20                                 yield return o;
21         }
22         
23         public static void Main ()
24         {
25                 var test = new Test ();
26                 test.Annotations<Test> ();
27         }
28 }