Author: marek
Date: 2006-11-17 18:13:26 -0500 (Fri, 17 Nov 2006)
New Revision: 68114
Added:
trunk/mcs/errors/cs0266-4.cs
trunk/mcs/errors/cs0557-3.cs
Log:
Add new tests.
Added: trunk/mcs/errors/cs0266-4.cs
===================================================================
--- trunk/mcs/errors/cs0266-4.cs 2006-11-17 23:11:36 UTC (rev 68113)
+++ trunk/mcs/errors/cs0266-4.cs 2006-11-17 23:13:26 UTC (rev 68114)
@@ -0,0 +1,20 @@
+// cs0266.cs: Cannot implicitly convert type `Bar' to `X'. An explicit
conversion exists (are you missing a cast?)
+// Line: 18
+
+public enum Bar
+{
+ ABar
+}
+
+class X
+{
+ public static explicit operator X (Bar the_bar)
+ {
+ return new X();
+ }
+
+ public static void Main ()
+ {
+ X x = Bar.ABar;
+ }
+}
Added: trunk/mcs/errors/cs0557-3.cs
===================================================================
--- trunk/mcs/errors/cs0557-3.cs 2006-11-17 23:11:36 UTC (rev 68113)
+++ trunk/mcs/errors/cs0557-3.cs 2006-11-17 23:13:26 UTC (rev 68114)
@@ -0,0 +1,20 @@
+// cs0557.cs: Duplicate user-defined conversion in type `Foo'
+// Line: 5
+
+public enum Bar
+{
+ ABar
+}
+
+
+public class Foo
+{
+ public static explicit operator Foo(Bar the_bar)
+ {
+ return new Foo();
+ }
+ public static implicit operator Foo(Bar the_bar)
+ {
+ return new Foo();
+ }
+}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches