Toggle the turbo button
[mono.git] / mcs / tests / dtest-040.cs
1 struct S<T1, T2>
2 {
3         public T1 First;
4         public T2 Second;
5 }
6
7 class A
8 {
9         public virtual S<U, object> Foo<U> (U u)
10         {
11                 return new S<U, object> ();
12         }
13 }
14
15 class B : A
16 {
17         public override S<T, dynamic> Foo<T> (T t)
18         {
19                 return new S<T, dynamic> () {
20                         First = t,
21                         Second = "second"
22                 };
23         }
24 }
25
26 public class MainClass
27 {
28         public static int Main ()
29         {
30                 B b = new B ();
31                 var res = b.Foo<int> (5);
32                 int i;
33                 i = res.First;
34                 if (i != 5)
35                         return 1;
36                 
37                 i = res.Second.Length;
38                 if (i != 6)
39                         return 2;
40                 
41                 res = b.Foo (4);
42                 i = res.First;
43                 if (i != 4)
44                         return 3;
45                 
46                 i = res.Second.Length;
47                 if (i != 6)
48                         return 4;
49                 
50                 return 0;
51         }
52 }