[w32file] Move MonoIO.Find{First,Next,Close} to managed
[mono.git] / mcs / tests / gtest-412.cs
1 using System;
2 using System.Reflection;
3
4 class Program
5 {
6         public static int Main ()
7         {
8                 Type type = typeof (Foo<>);
9                 Type [] gargs = type.GetGenericArguments ();
10                 if (gargs == null || gargs.Length != 1) {
11                         Console.WriteLine ("#1");
12                         return 1;
13                 }
14
15                 Type garg = gargs [0];
16                 Type [] csts = garg.GetGenericParameterConstraints ();
17
18                 if (garg.Name != "T") {
19                         Console.WriteLine ("#2: " + garg.Name);
20                         return 2;
21                 }
22                 if (garg.GenericParameterAttributes !=
23                         (GenericParameterAttributes.DefaultConstructorConstraint | GenericParameterAttributes.NotNullableValueTypeConstraint)) {
24                         Console.WriteLine ("#3: " + garg.GenericParameterAttributes);
25                         return 3;
26                 }
27                 if (csts == null || csts.Length != 1) {
28                         Console.WriteLine ("#4");
29                         return 4;
30                 }
31                 if (csts [0] != typeof (ValueType)) {
32                         Console.WriteLine ("#5: " + csts [0].FullName);
33                         return 5;
34                 }
35
36                 return 0;
37         }
38 }
39
40 struct Foo<T> where T : struct
41 {
42 }