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

gtest-571.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 75cd9a2a828ec405ef134aa2494f8c9a1955875f (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
using System;

public abstract class A<T>
{
	public abstract A<MM> For<MM> () where MM : T;
}

public class B<U, X, V> : A<V>
	where V : X
	where X : U
{
	readonly A<U> _inner;

	public B (A<U> inner)
	{
		_inner = inner;
	}

	public override A<PP> For<PP> () // base constraint is copied as PP : V
	{
		return _inner.For<PP> ();
	}
}

public class Test : A<Test>
{
	public static void Main ()
	{
		var t = new Test ();
		new B<Test, Test, Test> (t).For<Test> ();
	}

	public override A<QQ> For<QQ> ()
	{
		return null;
	}
}