Add test for #660685
authorRodrigo Kumpera <kumpera@gmail.com>
Thu, 13 Jan 2011 22:45:27 +0000 (23:45 +0100)
committerRodrigo Kumpera <kumpera@gmail.com>
Thu, 13 Jan 2011 22:46:03 +0000 (23:46 +0100)
mono/tests/verifier/valid_type_constraint_satisfy_reference_contraint.cs [new file with mode: 0644]

diff --git a/mono/tests/verifier/valid_type_constraint_satisfy_reference_contraint.cs b/mono/tests/verifier/valid_type_constraint_satisfy_reference_contraint.cs
new file mode 100644 (file)
index 0000000..bba7bbb
--- /dev/null
@@ -0,0 +1,35 @@
+using System;
+
+public class Control {}
+public class UserControl : Control {}
+
+namespace test
+{
+    public class MainPage : UserControl
+    {
+        public static void Main ()
+        {
+            var more = new MoreConstrained<MainPage>();
+            more.test(new MainPage ());
+        }
+    }
+
+    public class MoreConstrained<T> where T : Control
+    {
+        public void test(T param)
+        {
+            Console.WriteLine("More " + typeof(T) + " " + param);
+            var x = new LessConstrained<T>();
+            x.test<T>();
+        }
+    }
+
+    public class LessConstrained<T> where T : class
+    {
+        public void test<T2>()
+        {
+            Console.WriteLine("Less " + typeof(T2));
+        }
+    }
+
+}