From b6dc6e107730cc841ed6f7e9f903cd21e934ad65 Mon Sep 17 00:00:00 2001 From: Rodrigo Kumpera Date: Thu, 13 Jan 2011 23:45:27 +0100 Subject: [PATCH] Add test for #660685 --- ..._constraint_satisfy_reference_contraint.cs | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 mono/tests/verifier/valid_type_constraint_satisfy_reference_contraint.cs 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 index 00000000000..bba7bbbcb26 --- /dev/null +++ b/mono/tests/verifier/valid_type_constraint_satisfy_reference_contraint.cs @@ -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(); + more.test(new MainPage ()); + } + } + + public class MoreConstrained where T : Control + { + public void test(T param) + { + Console.WriteLine("More " + typeof(T) + " " + param); + var x = new LessConstrained(); + x.test(); + } + } + + public class LessConstrained where T : class + { + public void test() + { + Console.WriteLine("Less " + typeof(T2)); + } + } + +} -- 2.25.1