[Mono-bugs] [Bug 80177][Wis] New - gmcs does not compile code when csc does!

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Thu Dec 7 09:50:40 EST 2006


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 n.tomas at centras.lt.

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

--- shadow/80177	2006-12-07 09:50:40.000000000 -0500
+++ shadow/80177.tmp.22728	2006-12-07 09:50:40.000000000 -0500
@@ -0,0 +1,58 @@
+Bug#: 80177
+Product: Mono: Compilers
+Version: 1.2
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: C#
+AssignedTo: rharinath at novell.com                            
+ReportedBy: n.tomas at centras.lt               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: gmcs does not compile code when csc does!
+
+CASE1:
+    public delegate T XXX<T>();
+
+    class Program
+    {
+        static void Main(string[] args)
+        {
+            Int32 zz = new XXX<Int32>(delegate() { return 999; })();
+            Console.WriteLine(zz);
+        }
+    }
+
+gmcs does not compile it. output:
+
+error CS0031: Constant value `999' cannot be converted to a `T'
+error CS0031: Constant value `999' cannot be converted to a `T'
+
+
+csc.exe compiles it, no warnings or errors. executed performs like 
+expected.
+
+
+CASE2:
+    public delegate T XXX<T>(T t);
+
+    class Program
+    {
+        static void Main(string[] args)
+        {
+            int zz = new XXX<int>(delegate(int t) { return t; })(999);
+            Console.WriteLine(zz);
+        }
+    }
+
+gmcs does not compile it. output:
+error CS1678: Parameter `1' is declared as type `int' but should be `T'
+
+
+csc.exe compiles it, no warnings or errors. executed performs like 
+expected.


More information about the mono-bugs mailing list