blob: 5534de49c19b9bc3a5efcd571abdcd57e038f6ee (
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
|
// Compiler options: -r:gtest-582-lib.dll
using System;
using System.Reflection;
public class G1 : GC<C>
{
}
public class GC<T> where T : C
{
}
class Program
{
public static int Main()
{
var constraints = typeof (GC<>).GetGenericArguments ()[0].GetGenericParameterConstraints ();
if (constraints.Length != 1)
return 1;
if (constraints [0] != typeof (C))
return 2;
Console.WriteLine ("ok");
return 0;
}
}
|