[build] Fix warning (#4177)
[mono-project.git] / mcs / tests / gtest-iter-03.cs
blob6d0bd57375f91cbdab1a0408360f777afc5f6bbc
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 public static void Main ()
25 var test = new Test ();
26 test.Annotations<Test> ();