[Mono-bugs] [Bug 76584][Nor] New - [GMCS] (cf. #76551) missing "class" constraints on abstract generic method IL

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri Oct 28 14:10:21 EDT 2005


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by atsushi at ximian.com.

http://bugzilla.ximian.com/show_bug.cgi?id=76584

--- shadow/76584	2005-10-28 14:10:21.000000000 -0400
+++ shadow/76584.tmp.26318	2005-10-28 14:10:21.000000000 -0400
@@ -0,0 +1,58 @@
+Bug#: 76584
+Product: Mono: Compilers
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: martin at ximian.com                            
+ReportedBy: atsushi at ximian.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: [GMCS] (cf. #76551) missing "class" constraints on abstract generic method IL
+
+Similar to #76551, gmcs misses class constraints on abstract/overriden methods:
+
+using System;
+using System.Reflection;
+
+public abstract class Foo<T> where T : class
+{
+        public abstract Foo<K> UseT<K> () where K : class;
+}
+
+public class Bar<T> : Foo<T> where T : class
+{
+        public override Foo<K> UseT<K> () { return default (Foo<K>); }
+}
+
+public class Test
+{
+        public static void Main ()
+        {
+                MethodInfo mi = typeof (Bar<object>)
+                        .GetGenericTypeDefinition ().GetMethod ("UseT");
+                foreach (Type t in mi.GetGenericArguments ())
+                        Console.WriteLine (":::{0} {1}",
+                                t, t.GenericParameterAttributes);
+        }
+}
+
+Compile with gmcs and run either on MS.NET or Mono.
+
+Actual Results:
+
+:::K None
+
+Expected Results:
+
+:::K ReferenceTypeConstraint
+
+How often does this happen? 
+
+consistently.


More information about the mono-bugs mailing list