[Mono-bugs] [Bug 32218][Nor] New - Microsoft example gives ambiguous user-defined conversion

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
13 Oct 2002 04:53:21 -0000


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 tom7ca@yahoo.com.

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

--- shadow/32218	Sun Oct 13 00:53:21 2002
+++ shadow/32218.tmp.14190	Sun Oct 13 00:53:21 2002
@@ -0,0 +1,57 @@
+Bug#: 32218
+Product: Mono/MCS
+Version: unspecified
+OS: other
+OS Details: Debian Linux (unstable)
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: tom7ca@yahoo.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Microsoft example gives ambiguous user-defined conversion
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+
+Sample code from Microsoft results in an error.
+
+Steps to reproduce the problem:
+
+Look at the "user defined conversions tutorial" and try to compile the code:
+
+http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csref/html/vcwlkuser-definedconversionstutorial.asp
+
+Here is a short analog.
+
+using System;
+struct X {
+    static public implicit operator string(X x) {
+       return "x"; } }
+class Test { 
+    static public void Main() {
+        Console.WriteLine(new X()); } }
+
+Actual Results:
+
+$ mcs bug.cs
+Internal(1) error CS-0011: Ambiguous user defined conversion
+Compilation failed: 1 error(s), 0 warnings
+
+Expected Results:
+
+should compile without errors and output "x\n"
+
+How often does this happen? 
+
+always
+
+Additional Information:
+
+Debian packages 0.15-1 from CVS via www.debianplanet.org/mono