Correctly reapplied my last changes
authorMarek Safar <marek.safar@gmail.com>
Fri, 1 Dec 2006 18:56:09 +0000 (18:56 -0000)
committerMarek Safar <marek.safar@gmail.com>
Fri, 1 Dec 2006 18:56:09 +0000 (18:56 -0000)
svn path=/trunk/mcs/; revision=68838

16 files changed:
mcs/errors/cs0023-10.cs [new file with mode: 0644]
mcs/errors/cs0023-11.cs [new file with mode: 0644]
mcs/errors/cs0023-12.cs [new file with mode: 0644]
mcs/errors/cs0023-8.cs [new file with mode: 0644]
mcs/errors/cs0023-9.cs [new file with mode: 0644]
mcs/errors/cs0031-8.cs [new file with mode: 0644]
mcs/errors/cs0035.cs [new file with mode: 0644]
mcs/errors/cs0220-2.cs [new file with mode: 0644]
mcs/errors/cs0266-10.cs [new file with mode: 0644]
mcs/errors/cs0266-11.cs [new file with mode: 0644]
mcs/errors/cs0266-12.cs [new file with mode: 0644]
mcs/errors/cs0266-7.cs [new file with mode: 0644]
mcs/errors/cs0266-9.cs [new file with mode: 0644]
mcs/errors/cs0457-2.cs [new file with mode: 0644]
mcs/errors/cs0457.cs [new file with mode: 0644]
mcs/errors/cs0664-4.cs [new file with mode: 0644]

diff --git a/mcs/errors/cs0023-10.cs b/mcs/errors/cs0023-10.cs
new file mode 100644 (file)
index 0000000..7d0f82f
--- /dev/null
@@ -0,0 +1,7 @@
+// cs0023: The `+' operator cannot be applied to operand of type `X'\r
+// Line : 6\r
+\r
+class X {\r
+    static X x;\r
+    static object o = +x;\r
+}\r
diff --git a/mcs/errors/cs0023-11.cs b/mcs/errors/cs0023-11.cs
new file mode 100644 (file)
index 0000000..0328fb9
--- /dev/null
@@ -0,0 +1,17 @@
+// cs0023: The `-' operator cannot be applied to operand of type `A'\r
+// Line: 16\r
+\r
+\r
+class A\r
+{\r
+       public static implicit operator ulong (A mask)\r
+       {\r
+               return 8;\r
+       }\r
+}\r
+\r
+class X\r
+{\r
+    static A a = null;\r
+    static object o = -a;\r
+}\r
diff --git a/mcs/errors/cs0023-12.cs b/mcs/errors/cs0023-12.cs
new file mode 100644 (file)
index 0000000..670e373
--- /dev/null
@@ -0,0 +1,12 @@
+// cs0023: The `+' operator cannot be applied to operand of type `string'\r
+// Line: 10\r
+\r
+using System;\r
+\r
+public class Test\r
+{\r
+       static void Main ()\r
+       {\r
+               Console.WriteLine ("a" + + "b");\r
+       }\r
+}
\ No newline at end of file
diff --git a/mcs/errors/cs0023-8.cs b/mcs/errors/cs0023-8.cs
new file mode 100644 (file)
index 0000000..98f4549
--- /dev/null
@@ -0,0 +1,15 @@
+// cs0023: The `+' operator cannot be applied to operand of type `X'\r
+// Line : 6\r
+\r
+class X {\r
+        static void Foo (object o)\r
+        {\r
+        }\r
+        \r
+        static void Main () {\r
+                Foo (+(X)null);\r
+        }\r
+}\r
+\r
+\r
+\r
diff --git a/mcs/errors/cs0023-9.cs b/mcs/errors/cs0023-9.cs
new file mode 100644 (file)
index 0000000..fa20cd2
--- /dev/null
@@ -0,0 +1,10 @@
+// cs0023: The `-' operator cannot be applied to operand of type `ulong'\r
+// Line : 6\r
+\r
+class X {\r
+    const ulong a = 2;\r
+    const int b = -a;\r
+}\r
+\r
+\r
+\r
diff --git a/mcs/errors/cs0031-8.cs b/mcs/errors/cs0031-8.cs
new file mode 100644 (file)
index 0000000..a17afbd
--- /dev/null
@@ -0,0 +1,7 @@
+// cs0031: Constant value `-97' cannot be converted to a `uint'\r
+// Line: 9\r
+\r
+public class Test\r
+{\r
+       const uint b = -'a';\r
+}
\ No newline at end of file
diff --git a/mcs/errors/cs0035.cs b/mcs/errors/cs0035.cs
new file mode 100644 (file)
index 0000000..b4c98dc
--- /dev/null
@@ -0,0 +1,24 @@
+// CS0035 : Operator `+' is ambiguous on operands of type `Y' and `X'\r
+// Line: 22\r
+\r
+class A\r
+{\r
+       public static implicit operator float(A x)\r
+       {\r
+               return 0;\r
+       }\r
+\r
+       public static implicit operator decimal(A x)\r
+       {\r
+               return 0;\r
+       }\r
+}\r
+\r
+class M\r
+{\r
+       static void Main()\r
+       {\r
+               A a = new A ();\r
+               int i = -a;  \r
+       }\r
+}
\ No newline at end of file
diff --git a/mcs/errors/cs0220-2.cs b/mcs/errors/cs0220-2.cs
new file mode 100644 (file)
index 0000000..b2dc57b
--- /dev/null
@@ -0,0 +1,10 @@
+// cs0220.cs: The operation overflows at compile time in checked mode\r
+// Line: 7\r
+\r
+public class MainClass {\r
+        static void Main () {\r
+                int a = -int.MinValue;\r
+        }\r
+}\r
+\r
+\r
diff --git a/mcs/errors/cs0266-10.cs b/mcs/errors/cs0266-10.cs
new file mode 100644 (file)
index 0000000..cab2f62
--- /dev/null
@@ -0,0 +1,8 @@
+// cs0266: Cannot implicitly convert type `long' to `int'. An explicit conversion exists (are you missing a cast?)\r
+// Line: 7\r
+\r
+public class Test\r
+{\r
+       const uint a = 2147483648;\r
+       const int b = -a;\r
+}
\ No newline at end of file
diff --git a/mcs/errors/cs0266-11.cs b/mcs/errors/cs0266-11.cs
new file mode 100644 (file)
index 0000000..0910027
--- /dev/null
@@ -0,0 +1,14 @@
+// cs0266: Cannot implicitly convert type `int' to `X.E'. An explicit conversion exists (are you missing a cast?)\r
+// Line : 9\r
+\r
+class X {\r
+        enum E { }\r
+        \r
+        static void Main ()\r
+        {\r
+                const E e = 1 - 1;\r
+        }\r
+}\r
+\r
+\r
+\r
diff --git a/mcs/errors/cs0266-12.cs b/mcs/errors/cs0266-12.cs
new file mode 100644 (file)
index 0000000..68bbbf5
--- /dev/null
@@ -0,0 +1,11 @@
+// CS0266: Cannot implicitly convert type `int' to `char'. An explicit conversion exists (are you missing a cast?)\r
+// Line: 12\r
+\r
+class X\r
+{\r
+       public static void Main ()\r
+       {\r
+               char x = 'A';\r
+               char b = +x;\r
+       }\r
+}\r
diff --git a/mcs/errors/cs0266-7.cs b/mcs/errors/cs0266-7.cs
new file mode 100644 (file)
index 0000000..6f13790
--- /dev/null
@@ -0,0 +1,10 @@
+// cs0266: Cannot implicitly convert type `long' to `int'. An explicit conversion exists (are you missing a cast?)\r
+// Line : 6\r
+\r
+class X {\r
+    const uint a = 2;\r
+    const int b = -a;\r
+}\r
+\r
+\r
+\r
diff --git a/mcs/errors/cs0266-9.cs b/mcs/errors/cs0266-9.cs
new file mode 100644 (file)
index 0000000..8245440
--- /dev/null
@@ -0,0 +1,12 @@
+// cs0023: Operator `~' cannot be applied to operand of type `ulong'\r
+// Line : 6\r
+\r
+enum E1 { A }\r
+enum E2 { A }\r
+\r
+class X {\r
+    const E1 e = ~E2.A;\r
+}\r
+\r
+\r
+\r
diff --git a/mcs/errors/cs0457-2.cs b/mcs/errors/cs0457-2.cs
new file mode 100644 (file)
index 0000000..52af832
--- /dev/null
@@ -0,0 +1,21 @@
+// cs0457: Ambiguous user defined conversions `A.implicit operator byte(A)' and `A.implicit operator sbyte(A)' when converting from 'A' to 'int'\r
+// Line: 20\r
+\r
+class A\r
+{\r
+       public static implicit operator ushort (A mask)\r
+       {\r
+               return 1;\r
+       }\r
+\r
+       public static implicit operator short (A mask)\r
+       {\r
+               return 2;\r
+       }\r
+}\r
+\r
+class X\r
+{\r
+    static A a = null;\r
+    static object o = -a;\r
+}\r
diff --git a/mcs/errors/cs0457.cs b/mcs/errors/cs0457.cs
new file mode 100644 (file)
index 0000000..3b7ebc6
--- /dev/null
@@ -0,0 +1,21 @@
+// cs0457: Ambiguous user defined conversions `A.implicit operator byte(A)' and `A.implicit operator sbyte(A)' when converting from 'A' to 'int'\r
+// Line: 20\r
+\r
+class A\r
+{\r
+       public static implicit operator sbyte (A mask)\r
+       {\r
+               return 1;\r
+       }\r
+\r
+       public static implicit operator byte (A mask)\r
+       {\r
+               return 2;\r
+       }\r
+}\r
+\r
+class X\r
+{\r
+    static A a = null;\r
+    static object o = ~a;\r
+}\r
diff --git a/mcs/errors/cs0664-4.cs b/mcs/errors/cs0664-4.cs
new file mode 100644 (file)
index 0000000..1c9b29f
--- /dev/null
@@ -0,0 +1,9 @@
+// cs0664: Literal of type double cannot be implicitly converted to type `decimal'. Add suffix `m' to create a literal of this type\r
+// Line: 7\r
+\r
+class X {\r
+       void A ()\r
+       {\r
+               decimal d = -2.0;\r
+       }\r
+}\r