[Mono-bugs] [Bug 76482][Nor] New - [GMCS] gmcs emits extraneous base interfaces as generic parameter constraints

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Wed Oct 19 14:20:59 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=76482

--- shadow/76482	2005-10-19 14:20:59.000000000 -0400
+++ shadow/76482.tmp.1567	2005-10-19 14:20:59.000000000 -0400
@@ -0,0 +1,55 @@
+Bug#: 76482
+Product: Mono: Compilers
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: rharinath at novell.com                            
+ReportedBy: atsushi at ximian.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: [GMCS] gmcs emits extraneous base interfaces as generic parameter constraints
+
+The code below shows all of the generic parameter constraints for a generic
+argument of a generic method.
+
+using System;
+using System.Reflection;
+
+public interface IFoo : ICloneable {}
+
+public class Test
+{
+        public void Foo<T> () where T : IFoo {}
+
+        public static void Main ()
+        {
+                foreach (Type t in typeof (Test).GetMethod ("Foo")
+                        .GetGenericArguments () [0] // T
+                        .GetGenericParameterConstraints ())
+                        Console.WriteLine (t);
+        }
+}
+
+Actual Results:
+
+When it is compiled with gmcs and run, it outputs "IFoo" and "ICloneable".
+
+Expected Results:
+
+With csc, it only outputs "IFoo".
+
+How often does this happen?
+
+consistently.
+
+Additional Information:
+
+It is not a runtime/classlib matter but gmcs matter (gmcs-compiled binary
+shows ICloneable on .NET).


More information about the mono-bugs mailing list