Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / tests / gtest-511.cs
1 interface IA : IB
2 {
3 }
4
5 interface IB
6 {
7 }
8
9 class A<T> where T : IA
10 {
11 }
12
13 class C
14 {
15         public virtual void Foo<T> (A<T> t) where T : IA
16         {
17         }
18 }
19
20 class D : C
21 {
22         public override void Foo<T> (A<T> t)
23         {
24         }
25         
26         public static int Main ()
27         {
28                 new D ();
29                 
30                 var m = typeof (D).GetMethod ("Foo");
31                 var ga = m.GetGenericArguments() [0];
32                 
33                 var tpConstraints = ga.GetGenericParameterConstraints();
34                 if (tpConstraints.Length != 1)
35                         return 1;
36                 
37                 if (tpConstraints [0] != typeof (IA))
38                         return 2;
39                 
40                 return 0;
41         }
42 }