summaryrefslogtreecommitdiff
path: root/mcs/errors/cs0313-2.cs
blob: 7489c65f72002d9e042c2bf9a502cb6c9b8bb4f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// CS0313: The type `S?' cannot be used as type parameter `T' in the generic type or method `C<I>.Foo<T>(T)'. The nullable type `S?' never satisfies interface constraint `I'
// Line: 20

struct S : I
{
}

interface I
{
}

class C<U>
{
	static void Foo<T> (T value) where T : U
	{
	}

	static void Bar (S? s)
	{
		C<I>.Foo (s);
	}
}