[Mono-bugs] [Bug 61128][Wis] New - BUG: Static ToString method problem...
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Sat, 3 Jul 2004 11:56:35 -0400 (EDT)
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 vguzev@yandex.ru.
http://bugzilla.ximian.com/show_bug.cgi?id=61128
--- shadow/61128 2004-07-03 11:56:35.000000000 -0400
+++ shadow/61128.tmp.8450 2004-07-03 11:56:35.000000000 -0400
@@ -0,0 +1,73 @@
+Bug#: 61128
+Product: Mono: Compilers
+Version: unspecified
+OS: Red Hat 9.0
+OS Details: Linux skif 2.4.25 #2 SMP Fri Apr 23 14:03:00 MSD 2004 i686 athlon i386 GNU/Linux
+Status: NEW
+Resolution:
+Severity:
+Priority: Wishlist
+Component: C#
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: vguzev@yandex.ru
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: BUG: Static ToString method problem...
+
+Look at the following files a.cs and q.cs:
+8<------------------------------------------------
+[vadim@skif static_tostring]$ cat a.cs
+using System;
+using Q;
+
+public class B {
+ public static void Main( string[] args ) {
+ Console.WriteLine( A.ToString() );
+ }
+}
+[vadim@skif static_tostring]$ cat q.cs
+namespace Q {
+ public class A {
+ public static new string ToString() {
+ return "Hello world!";
+ }
+ }
+}
+8<------------------------------------------------
+
+Try to compile them - you'll see the following:
+
+8<------------------------------------------------
+[vadim@skif static_tostring]$ mcs /t:library q.cs
+Compilation succeeded
+[vadim@skif static_tostring]$ mcs /r:q.dll a.cs
+a.cs(6) error CS0121: Ambiguous call when selecting function due to
+implicit casts
+a.cs(6) error CS8006: Could not find any applicable function for this
+argument list
+Compilation failed: 2 error(s), 0 warnings
+8<------------------------------------------------
+
+The same example works perfectly on MS .Net 1.0. I think that it's a
+problem with C# compiler as it was in bug
+http://bugzilla.ximian.com/show_bug.cgi?id=52931
+
+Here's my system info:
+8<------------------------------------------------
+Linux skif 2.4.25 #2 SMP Fri Apr 23 14:03:00 MSD 2004 i686 athlon i386
+GNU/Linux
+gcc (GCC) 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
+Mono JIT compiler version 1.0, (C) 2002-2004 Novell, Inc and Contributors.
+www.go-mono.com
+ TLS: normal
+ GC: Included Boehm (with typed GC)
+ SIGSEGV : normal
+ Globalization: ICU
+8<------------------------------------------------
+
+
+Best regards,
+Vadim B. Guzev
+http://u.pereslavl.ru/~vadim/MCSharp/