[interp] Reduce computation under calc_section mutex
[mono-project.git] / mcs / tests / dtest-040.cs
blob5cfa4e915d6d8b248f48eb3c82bb19318d13a7aa
1 struct S<T1, T2>
3 public T1 First;
4 public T2 Second;
7 class A
9 public virtual S<U, object> Foo<U> (U u)
11 return new S<U, object> ();
15 class B : A
17 public override S<T, dynamic> Foo<T> (T t)
19 return new S<T, dynamic> () {
20 First = t,
21 Second = "second"
26 public class MainClass
28 public static int Main ()
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;
37 i = res.Second.Length;
38 if (i != 6)
39 return 2;
41 res = b.Foo (4);
42 i = res.First;
43 if (i != 4)
44 return 3;
46 i = res.Second.Length;
47 if (i != 6)
48 return 4;
50 return 0;