New tests.
authorMarek Safar <marek.safar@gmail.com>
Thu, 5 Nov 2009 18:08:26 +0000 (18:08 -0000)
committerMarek Safar <marek.safar@gmail.com>
Thu, 5 Nov 2009 18:08:26 +0000 (18:08 -0000)
svn path=/trunk/mcs/; revision=145520

17 files changed:
mcs/errors/cs0182-8.cs [new file with mode: 0644]
mcs/errors/cs0206-2.cs
mcs/errors/cs0206.cs
mcs/errors/cs1736-2.cs [new file with mode: 0644]
mcs/errors/cs1750.cs
mcs/errors/cs1763-2.cs [deleted file]
mcs/errors/cs1975.cs [new file with mode: 0644]
mcs/errors/dcs1963.cs [new file with mode: 0644]
mcs/errors/dcs1976.cs [new file with mode: 0644]
mcs/errors/dcs1977.cs [new file with mode: 0644]
mcs/errors/dcs1978-2.cs [new file with mode: 0644]
mcs/errors/dcs1978-3.cs [new file with mode: 0644]
mcs/errors/dcs1978.cs [new file with mode: 0644]
mcs/errors/gcs0206.cs
mcs/errors/gcs1067.cs [new file with mode: 0644]
mcs/errors/gcs1750.cs [new file with mode: 0644]
mcs/errors/gcs1770.cs [new file with mode: 0644]

diff --git a/mcs/errors/cs0182-8.cs b/mcs/errors/cs0182-8.cs
new file mode 100644 (file)
index 0000000..cbaafd0
--- /dev/null
@@ -0,0 +1,21 @@
+// CS0182: An attribute argument must be a constant expression, typeof expression or array creation expression
+// Line: 13
+
+using System;
+
+class AAttribute : Attribute
+{
+       public AAttribute (dynamic X)
+       {
+       }
+}
+
+[A (Test.B)]
+class Test
+{
+       public static dynamic B;
+
+       static void Main ()
+       {
+       }
+}
index 210590692461497e6a38a97d43c984fefb27ccd0..da3a554506dbc1dd5617bcac31e7f2219efe3f97 100644 (file)
@@ -1,4 +1,4 @@
-// CS0206: A property or indexer may not be passed as an out or ref parameter
+// CS0206: A property, indexer or dynamic member access may not be passed as `ref' or `out' parameter
 // Line: 22
 
 using System;
index db0450affb3b2dce1f0f27f1091c92797a61a403..2b5a11327847dec09f86a373aba4e18e691d54fc 100644 (file)
@@ -1,4 +1,4 @@
-// CS0206:  A property or indexer `X.P' may not be passed as `ref' or `out' parameter
+// CS0206: A property, indexer or dynamic member access may not be passed as `ref' or `out' parameter
 // Line: 15
 
 class X {
diff --git a/mcs/errors/cs1736-2.cs b/mcs/errors/cs1736-2.cs
new file mode 100644 (file)
index 0000000..bd22ecf
--- /dev/null
@@ -0,0 +1,13 @@
+// CS1763: The expression being assigned to optional parameter `c' must be a constant or default value
+// Line: 10
+
+struct S
+{
+}
+
+class C
+{
+       public static void Test (C c = new S ())
+       {
+       }
+}
index 9aa7f2387a47149dd64a34e10f3811129423427e..15b09c384911dc06da2aa68f6eb00dfa17474bb3 100644 (file)
@@ -1,6 +1,5 @@
-// CS1750: Optional parameter value `a' cannot be converted to parameter type `int'
+// CS1750: Optional parameter expression of type `string' cannot be converted to parameter type `int'
 // Line: 6
-// Compiler options: -langversion:future
 
 public class C
 {
diff --git a/mcs/errors/cs1763-2.cs b/mcs/errors/cs1763-2.cs
deleted file mode 100644 (file)
index b4c0ef5..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-// CS1763: Optional parameter `c' of type `C' can only be initialized with `null'
-// Line: 10
-// Compiler options: -langversion:future
-
-struct S
-{
-}
-
-class C
-{
-       public static void Test (C c = new S ())
-       {
-       }
-}
diff --git a/mcs/errors/cs1975.cs b/mcs/errors/cs1975.cs
new file mode 100644 (file)
index 0000000..8811645
--- /dev/null
@@ -0,0 +1,17 @@
+// CS1975: The constructor call cannot be dynamically dispatched within constructor initializer
+// Line: 14
+
+public class A
+{
+       public A (dynamic arg)
+       {
+       }
+}
+
+public class B : A
+{
+       public B (dynamic arg)
+               : base (arg)
+       {
+       }
+}
diff --git a/mcs/errors/dcs1963.cs b/mcs/errors/dcs1963.cs
new file mode 100644 (file)
index 0000000..4f7106e
--- /dev/null
@@ -0,0 +1,14 @@
+// CS1963: An expression tree cannot contain a dynamic operation
+// Line: 12
+
+using System;
+using System.Linq.Expressions;
+
+class C
+{
+       public static void Main ()
+       {
+               dynamic d = 1;
+               Expression<Func<int>> e = () => d + 1;
+       }
+}
diff --git a/mcs/errors/dcs1976.cs b/mcs/errors/dcs1976.cs
new file mode 100644 (file)
index 0000000..e03e2f3
--- /dev/null
@@ -0,0 +1,11 @@
+// CS1976: The method group `Main' cannot be used as an argument of dynamic operation. Consider using parentheses to invoke the method
+// Line: 9
+
+class C
+{
+       public static void Main ()
+       {
+               dynamic d = null;
+               d (Main);
+       }
+}
diff --git a/mcs/errors/dcs1977.cs b/mcs/errors/dcs1977.cs
new file mode 100644 (file)
index 0000000..65d1f71
--- /dev/null
@@ -0,0 +1,11 @@
+// CS1977: An anonymous method or lambda expression cannot be used as an argument of dynamic operation without a cast
+// Line: 9
+
+class C
+{
+       public static void Main ()
+       {
+               dynamic d = null;
+               d (delegate {});
+       }
+}
diff --git a/mcs/errors/dcs1978-2.cs b/mcs/errors/dcs1978-2.cs
new file mode 100644 (file)
index 0000000..9e9b33c
--- /dev/null
@@ -0,0 +1,11 @@
+// CS1978: An expression of type `void' cannot be used as an argument of dynamic operation
+// Line: 9
+
+class C
+{
+       public static void Main ()
+       {
+               dynamic d = null;
+               d (Main ());
+       }
+}
diff --git a/mcs/errors/dcs1978-3.cs b/mcs/errors/dcs1978-3.cs
new file mode 100644 (file)
index 0000000..d185191
--- /dev/null
@@ -0,0 +1,12 @@
+// CS1978: An expression of type `int*' cannot be used as an argument of dynamic operation
+// Line: 9
+// Compiler options: -unsafe
+
+unsafe class C
+{
+       public static void Main ()
+       {
+               dynamic d = null;
+               d ((int*)0);
+       }
+}
diff --git a/mcs/errors/dcs1978.cs b/mcs/errors/dcs1978.cs
new file mode 100644 (file)
index 0000000..acc781b
--- /dev/null
@@ -0,0 +1,11 @@
+// CS1978: An expression of type `__arglist' cannot be used as an argument of dynamic operation
+// Line: 9
+
+class C
+{
+       public static void Main ()
+       {
+               dynamic d = null;
+               d (__arglist (111));
+       }
+}
index 36be34da8019d92f24929e7004c8650354eaf98e..805577b47b2ed5ca21ace8125817fb114d84e290 100644 (file)
@@ -1,7 +1,6 @@
-// CS0206: A property or indexer `anonymous type.Foo' may not be passed as `ref' or `out' parameter
+// CS0206: A property, indexer or dynamic member access may not be passed as `ref' or `out' parameter
 // Line: 14
 
-
 class C
 {
        static void Foo (ref object o)
diff --git a/mcs/errors/gcs1067.cs b/mcs/errors/gcs1067.cs
new file mode 100644 (file)
index 0000000..dbe433e
--- /dev/null
@@ -0,0 +1,10 @@
+// CS1067: Partial declarations of `I<T>' must have the same type parameter variance modifiers
+// Line: 8
+
+partial interface I<in T>
+{
+}
+
+partial interface I<out T>
+{
+}
diff --git a/mcs/errors/gcs1750.cs b/mcs/errors/gcs1750.cs
new file mode 100644 (file)
index 0000000..9673a74
--- /dev/null
@@ -0,0 +1,9 @@
+// CS1750: Optional parameter expression of type `decimal' cannot be converted to parameter type `int?'
+// Line: 6
+
+public class TS
+{
+       public static void Test (int? i = 1m)
+       {
+       }
+}
diff --git a/mcs/errors/gcs1770.cs b/mcs/errors/gcs1770.cs
new file mode 100644 (file)
index 0000000..e73ead0
--- /dev/null
@@ -0,0 +1,11 @@
+// CS1770: The expression being assigned to nullable optional parameter `d' must be default value
+// Line: 8
+
+using System;
+
+class C
+{
+       public static void Foo (DateTime? d = new DateTime ())
+       {
+       }
+}