--- /dev/null
+// 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
--- /dev/null
+// 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
--- /dev/null
+// 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
--- /dev/null
+// 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
--- /dev/null
+// 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
--- /dev/null
+// 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
--- /dev/null
+// 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
--- /dev/null
+// 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
--- /dev/null
+// 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
--- /dev/null
+// 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
--- /dev/null
+// 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
--- /dev/null
+// 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
--- /dev/null
+// 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
--- /dev/null
+// 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
--- /dev/null
+// 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
-// CS0403: Cannot convert null to the type parameter `T' becaues it could be a value type. Consider using `default (T)' instead\r
+// CS0403: Cannot convert null to the type parameter `T' because it could be a value type. Consider using `default (T)' instead\r
// Line: 8\r
\r
struct S\r
-// CS0403: Cannot convert null to the type parameter `T' becaues it could be a value type. Consider using `default (T)' instead
+// CS0403: Cannot convert null to the type parameter `T' because it could be a value type. Consider using `default (T)' instead
// Line: 7
class Test<T>
{
cs1586.cs
cs1641.cs
cs1670-2.cs
+
+# Unary operators
+cs0035.cs
+cs0266-10.cs
+cs0266-11.cs
+cs0266-7.cs
+cs0266-9.cs
+cs0457-2.cs
+cs0457.cs
\ No newline at end of file
cs1586.cs
cs1641.cs
cs1670-2.cs
+
+# Unary operators
+cs0035.cs
+cs0266-10.cs
+cs0266-11.cs
+cs0266-7.cs
+cs0266-9.cs
+cs0457-2.cs
+cs0457.cs
\ No newline at end of file