Imported Upstream version 3.6.0

Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
This commit is contained in:
Jo Shields
2014-08-13 10:39:27 +01:00
commit a575963da9
50588 changed files with 8155799 additions and 0 deletions

42
mcs/tests/gtest-412.cs Normal file
View File

@@ -0,0 +1,42 @@
using System;
using System.Reflection;
class Program
{
public static int Main ()
{
Type type = typeof (Foo<>);
Type [] gargs = type.GetGenericArguments ();
if (gargs == null || gargs.Length != 1) {
Console.WriteLine ("#1");
return 1;
}
Type garg = gargs [0];
Type [] csts = garg.GetGenericParameterConstraints ();
if (garg.Name != "T") {
Console.WriteLine ("#2: " + garg.Name);
return 2;
}
if (garg.GenericParameterAttributes !=
(GenericParameterAttributes.DefaultConstructorConstraint | GenericParameterAttributes.NotNullableValueTypeConstraint)) {
Console.WriteLine ("#3: " + garg.GenericParameterAttributes);
return 3;
}
if (csts == null || csts.Length != 1) {
Console.WriteLine ("#4");
return 4;
}
if (csts [0] != typeof (ValueType)) {
Console.WriteLine ("#5: " + csts [0].FullName);
return 5;
}
return 0;
}
}
struct Foo<T> where T : struct
{
}