New tests.
authorMarek Safar <marek.safar@gmail.com>
Sat, 23 Sep 2006 18:39:27 +0000 (18:39 -0000)
committerMarek Safar <marek.safar@gmail.com>
Sat, 23 Sep 2006 18:39:27 +0000 (18:39 -0000)
svn path=/trunk/mcs/; revision=65834

mcs/errors/cs0283-3.cs [new file with mode: 0644]
mcs/errors/cs1547-6.cs [new file with mode: 0644]
mcs/errors/cs1547-7.cs [new file with mode: 0644]
mcs/errors/gcs0019-4.cs [new file with mode: 0644]
mcs/errors/gcs0029-2.cs [new file with mode: 0644]
mcs/errors/gcs0029-3.cs [new file with mode: 0644]
mcs/errors/gcs0030-2.cs [new file with mode: 0644]
mcs/errors/gcs1547-2.cs [new file with mode: 0644]

diff --git a/mcs/errors/cs0283-3.cs b/mcs/errors/cs0283-3.cs
new file mode 100644 (file)
index 0000000..3d71aad
--- /dev/null
@@ -0,0 +1,8 @@
+// CS0283: The type `int*' cannot be declared const\r
+// Line: 10\r
+// Compiler options: -unsafe\r
+\r
+unsafe class Test\r
+{\r
+       const int* o = null;\r
+}
\ No newline at end of file
diff --git a/mcs/errors/cs1547-6.cs b/mcs/errors/cs1547-6.cs
new file mode 100644 (file)
index 0000000..f8605cf
--- /dev/null
@@ -0,0 +1,6 @@
+// CS1547: Keyword `void' cannot be used in this context
+// Line: 6
+
+class C {\r
+       object o = new void();\r
+}
\ No newline at end of file
diff --git a/mcs/errors/cs1547-7.cs b/mcs/errors/cs1547-7.cs
new file mode 100644 (file)
index 0000000..874a0a3
--- /dev/null
@@ -0,0 +1,12 @@
+// CS1547: Keyword `void' cannot be used in this context
+// Line: 6
+
+class C\r
+{\r
+       int Foo ()\r
+       {\r
+               foreach (void v in this)\r
+               {\r
+               }\r
+       }\r
+}
\ No newline at end of file
diff --git a/mcs/errors/gcs0019-4.cs b/mcs/errors/gcs0019-4.cs
new file mode 100644 (file)
index 0000000..8ed3ba1
--- /dev/null
@@ -0,0 +1,16 @@
+// CS0019: Operator `+' cannot be applied to operands of type `EventHandler' and `T'
+// Line: 10\r
+\r
+using System;\r
+\r
+public delegate void EventHandler (int i, int j);\r
+\r
+public class Button {\r
+\r
+       public event EventHandler Click;\r
+\r
+       public void Connect<T> () where T : class\r
+       {\r
+               Click += default (T);\r
+       }\r
+}\r
diff --git a/mcs/errors/gcs0029-2.cs b/mcs/errors/gcs0029-2.cs
new file mode 100644 (file)
index 0000000..14ccaeb
--- /dev/null
@@ -0,0 +1,10 @@
+// CS0029: Cannot implicitly convert type `T' to `int*'
+// Line : 8
+// Compiler options: -unsafe\r
+\r
+class T {\r
+       static unsafe int Main ()\r
+       {\r
+               int *a = default(T);\r
+       }\r
+}\r
diff --git a/mcs/errors/gcs0029-3.cs b/mcs/errors/gcs0029-3.cs
new file mode 100644 (file)
index 0000000..9c70962
--- /dev/null
@@ -0,0 +1,9 @@
+// CS0029: Cannot implicitly convert type `bool' to `int'
+// Line : 7
+\r
+class T {\r
+       static int Main ()\r
+       {\r
+               int a = default(bool);\r
+       }\r
+}\r
diff --git a/mcs/errors/gcs0030-2.cs b/mcs/errors/gcs0030-2.cs
new file mode 100644 (file)
index 0000000..1031bb8
--- /dev/null
@@ -0,0 +1,12 @@
+// CS0030: Cannot convert type `X' to `S'\r
+// Line: 10\r
+\r
+struct S {\r
+}\r
+\r
+class X {\r
+       static void Main ()\r
+       {\r
+               S s = (S)default(X);\r
+       }\r
+}\r
diff --git a/mcs/errors/gcs1547-2.cs b/mcs/errors/gcs1547-2.cs
new file mode 100644 (file)
index 0000000..f4fb26c
--- /dev/null
@@ -0,0 +1,10 @@
+// CS1547: Keyword `void' cannot be used in this context
+// Line: 8
+
+class X
+{
+       static void Main ()
+       {
+               object o = default(void);
+       }
+}