Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / tests / gtest-562.cs
1 interface IFoo { }
2
3 abstract class A<T>
4 {
5         public T Value;
6 }
7
8 class B<U> : A<B<U>>, IFoo
9 {
10         public void Test ()
11         {
12                 IFoo foo = this;
13                 Value = this;
14         }
15 }
16
17 class C<U> : A<C<U>.N>, IFoo
18 {
19         public void Test ()
20         {
21                 IFoo foo = this;
22                 Value = new N ();
23         }
24         
25         public class N
26         {
27         }
28 }
29
30 class D<U> : A<D<int>>
31 {
32         public void Test ()
33         {
34                 Value = new D<int> ();
35         }
36 }
37
38 class E<U> : IFoo where U : A<E<U>>
39 {
40         public void Test (U u)
41         {
42                 IFoo foo = u.Value;
43         }
44 }
45
46 static class Application
47 {
48         public static int Main ()
49         {
50                 new B<byte>().Test ();
51                 new C<char>().Test ();
52                 new D<string>().Test ();
53                 
54                 return 0;
55         }
56 }