[Mono-bugs] [Bug 77227][Nor] New - mcs allows overloads that violate CLS rules

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Thu Jan 12 14:09:05 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 doza at sztorm.net.

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

--- shadow/77227	2006-01-12 14:09:05.000000000 -0500
+++ shadow/77227.tmp.14677	2006-01-12 14:09:05.000000000 -0500
@@ -0,0 +1,48 @@
+Bug#: 77227
+Product: Mono: Compilers
+Version: 1.1
+OS: 
+OS Details: ubuntu dapper
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: rharinath at novell.com                            
+ReportedBy: doza at sztorm.net               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: mcs allows overloads that violate CLS rules
+
+Related to: http://bugzilla.ximian.com/show_bug.cgi?id=77226
+
+mcs: 1.1.13
+
+C# as a CLS producer shouldn't allow overloaded methods to differ only by
+"ref" modifier, but it does. Compilation of this code should generate error
+or at least warning:
+
+class HelloWorld
+{
+    static void Main(string[] args)
+    {
+        string s = "Hello world";
+        Hello(s);
+        System.Console.WriteLine(s);		
+        Hello(ref s);
+        System.Console.WriteLine(s);		
+    }
+
+    public static void Hello(string text)
+    {
+        System.Console.WriteLine(text);
+    }
+
+    public static void Hello(ref string text)
+    {
+        System.Console.WriteLine(text);
+        text = "done";
+    }
+}


More information about the mono-bugs mailing list