Updated with review feedback.
[mono.git] / mcs / tests / test-anon-121.cs
1 using System;
2 using System.Collections.Generic;
3
4 internal delegate void EmptyDelegate ();
5
6 class BaseObject
7 {
8         public static int Main ()
9         {
10                 int? i;
11                 Query <BaseObject> (out i);
12                 return 0;
13         }
14
15         static void Closure (EmptyDelegate x)
16         {
17         }
18
19         static List<T> Query<T> (out int? count)  where T : BaseObject
20         {
21                 count = 0;
22                 List<T> results = new List<T> ();
23                 Closure (delegate {
24                         results.Add (MakeSomething<T> ());
25                 });
26                 return results;
27         }
28
29         static T MakeSomething<T> () where T : BaseObject
30         {
31                 return null;
32         }
33 }
34