--- /dev/null
+using System;
+
+static class Maybe
+{
+ public static Maybe<T> C<T> (T value)
+ {
+ return null;
+ }
+}
+
+sealed class Maybe<T>
+{
+ public Maybe (T value)
+ {
+ }
+}
+
+static class Extensions {
+ public static R Match<T,R>(this T self, params Func<T,Maybe<R>>[] matchers)
+ {
+ return default (R);
+ }
+}
+
+class Test {
+ public static void Main ()
+ {
+ Extensions.Match ("a", s => Maybe.C(s));
+ }
+}
--- /dev/null
+using System;
+using System.Reflection;
+
+class Program
+{
+ 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
+{
+}
</method>
</type>
</test>
+ <test name="gtest-411.cs">
+ <type name="Maybe">
+ <method name="Maybe`1[T] C[T](T)">
+ <size>2</size>
+ </method>
+ </type>
+ <type name="Maybe`1[T]">
+ <method name="Void .ctor(T)">
+ <size>7</size>
+ </method>
+ </type>
+ <type name="Extensions">
+ <method name="R Match[T,R](T, System.Func`2[T,Maybe`1[R]][])">
+ <size>10</size>
+ </method>
+ </type>
+ <type name="Test">
+ <method name="Void .ctor()">
+ <size>7</size>
+ </method>
+ <method name="Void Main()">
+ <size>50</size>
+ </method>
+ <method name="Maybe`1[System.String] <Main>m__0(System.String)">
+ <size>7</size>
+ </method>
+ </type>
+ </test>
+ <test name="gtest-412.cs">
+ <type name="Program">
+ <method name="Void .ctor()">
+ <size>7</size>
+ </method>
+ <method name="Int32 Main()">
+ <size>213</size>
+ </method>
+ </type>
+ </test>
<test name="gtest-anon-1.cs">
<type name="X">
<method name="Void .ctor()">