Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gtest-562.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9cd8d921c90b36bb15c173fccde38c8eb7119630 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
interface IFoo { }

abstract class A<T>
{
	public T Value;
}

class B<U> : A<B<U>>, IFoo
{
	public void Test ()
	{
		IFoo foo = this;
		Value = this;
	}
}

class C<U> : A<C<U>.N>, IFoo
{
	public void Test ()
	{
		IFoo foo = this;
		Value = new N ();
	}
	
	public class N
	{
	}
}

class D<U> : A<D<int>>
{
	public void Test ()
	{
		Value = new D<int> ();
	}
}

class E<U> : IFoo where U : A<E<U>>
{
	public void Test (U u)
	{
		IFoo foo = u.Value;
	}
}

static class Application
{
	public static int Main ()
	{
		new B<byte>().Test ();
		new C<char>().Test ();
		new D<string>().Test ();
		
		return 0;
	}
}