[Mono-bugs] [Bug 78000][Nor] New - Change in C# invalid conversion.
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Mon Apr 3 15:01:52 EDT 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 miguel at ximian.com.
http://bugzilla.ximian.com/show_bug.cgi?id=78000
--- shadow/78000 2006-04-03 15:01:52.000000000 -0400
+++ shadow/78000.tmp.28008 2006-04-03 15:01:52.000000000 -0400
@@ -0,0 +1,46 @@
+Bug#: 78000
+Product: Mono: Compilers
+Version: unspecified
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: C#
+AssignedTo: rharinath at novell.com
+ReportedBy: miguel at ximian.com
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Change in C# invalid conversion.
+
+Seems like Microsoft fixed a bug in their C# 1.0 compiler, as reported by
+Jon Jagger:
+
+
+interface I { }
+class A : I { }
+class B
+{
+ public static implicit operator A(B from)
+ {
+ return new A();
+ }
+}
+
+class App
+{
+ public static void Main()
+ {
+ B b = new B();
+ I i = b;
+ }
+}
+
+Under .NET the last line (converting from B to I) does _not_ compile.
+Under Mono it does.
+In .NET 1.1 it _did_ compile but after I queried it with Peter Hallam he
+confirmed it was a bug.
+As far as I can tell the spec needs tightening to cover this case.
More information about the mono-bugs
mailing list