dlr bug
[mcs.git] / tests / gtest-iter-03.cs
blob24b2b307cfeb90cce00f5aa0dcc7c0ad892fc188
1 using System;
2 using System.Collections.Generic;
4 public class Test {
6 List<object> annotations = new List<object> ();
8 public IEnumerable<T> Annotations<T> () where T : class
10 foreach (T o in Annotations (typeof (T)))
11 yield return o;
14 public IEnumerable<object> Annotations (Type type)
16 if (annotations == null)
17 yield break;
18 foreach (object o in annotations)
19 if (o.GetType () == type)
20 yield return o;
23 static void Main ()
25 var test = new Test ();
26 test.Annotations<Test> ();