summaryrefslogtreecommitdiff
path: root/mcs/tests/dtest-030.cs
blob: 979e71965c54ae1950ecb3e8ef82f6f1e6a99a90 (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
using System;

class A<T>
{
}

class B
{
	static void M1<T> (T t) where T : struct
	{
	}
	
	static void M2<T, U> (T t, U u) where U : IEquatable<T>
	{
	}
	
	static void M3<T, U> (T t, A<U> u) where U : IEquatable<T>
	{
	}

	static void M4<T, U> (T t, IEquatable<U> u) where T : IEquatable<U>
	{
	}

	public static void Main ()
	{
		dynamic d = 2;
		M1 (d);
		
		M2 (d, 6);
		M2 (4, d);
		
		M3 (d, new A<int> ());
		
		M4 (d, 6);
		// TODO: type inference
		//M4 (4, d);
	}
}