New tests + update
authorMarek Safar <marek.safar@gmail.com>
Fri, 12 Oct 2007 17:11:00 +0000 (17:11 -0000)
committerMarek Safar <marek.safar@gmail.com>
Fri, 12 Oct 2007 17:11:00 +0000 (17:11 -0000)
svn path=/trunk/mcs/; revision=87408

mcs/errors/cs0206.cs
mcs/errors/gcs0037-2.cs [new file with mode: 0644]
mcs/errors/gcs0206.cs [new file with mode: 0644]
mcs/errors/gcs1501-2.cs [new file with mode: 0644]
mcs/errors/gcs1939.cs [new file with mode: 0644]
mcs/errors/gcs1942-2.cs [new file with mode: 0644]
mcs/errors/gcs1942.cs [new file with mode: 0644]

index 3fe60407e6a4dc31bdbc7b5462208640afb8b83f..db0450affb3b2dce1f0f27f1091c92797a61a403 100644 (file)
@@ -1,5 +1,6 @@
-// cs0206.cs: A property or indexer `X.P' may not be passed as an out or ref parameter
-// Line:
+// CS0206:  A property or indexer `X.P' may not be passed as `ref' or `out' parameter
+// Line: 15
+
 class X {
        static int P { get { return 1; } set { } }
 
diff --git a/mcs/errors/gcs0037-2.cs b/mcs/errors/gcs0037-2.cs
new file mode 100644 (file)
index 0000000..ba1b1d5
--- /dev/null
@@ -0,0 +1,21 @@
+// CS0037: Cannot convert null to `bool' because it is a value type
+// Line: 19
+// Compiler options: -langversion:linq
+
+using System;
+
+class TestA
+{
+       public string Select (Func<TestA, bool> f)
+       {
+               return "";
+       }
+}
+
+public class C
+{
+       static void Main ()
+       {
+               string foo = from a in new TestA () select null;
+       }
+}
diff --git a/mcs/errors/gcs0206.cs b/mcs/errors/gcs0206.cs
new file mode 100644 (file)
index 0000000..241f21b
--- /dev/null
@@ -0,0 +1,17 @@
+// CS0206: A property or indexer `anonymous type.Foo' may not be passed as `ref' or `out' parameter
+// Line: 14
+// Compiler options: -langversion:linq
+
+class C
+{
+       static void Foo (ref object o)
+       {
+       }
+       
+       public static void Main ()
+       {
+               var v = new { Foo = "Bar" };
+               
+               Foo (ref v.Foo);
+       }
+}
diff --git a/mcs/errors/gcs1501-2.cs b/mcs/errors/gcs1501-2.cs
new file mode 100644 (file)
index 0000000..920afc0
--- /dev/null
@@ -0,0 +1,29 @@
+// CS1501: No overload for method `Select' takes `1' arguments
+// Line: 17
+// Compiler options: -langversion:linq
+
+using System;
+
+class TestA
+{
+       public string value;
+       
+       public TestA (string value)
+       {
+               this.value = value;
+       }
+       
+       public string Select (int i, Func<TestA, TestA> f)
+       {
+               return value;
+       }
+}
+
+public class M
+{
+       static void Main ()
+       {
+               var v = new TestA ("Oh yes");
+               string foo = from a in v select a;
+       }
+}
diff --git a/mcs/errors/gcs1939.cs b/mcs/errors/gcs1939.cs
new file mode 100644 (file)
index 0000000..5a60ec3
--- /dev/null
@@ -0,0 +1,21 @@
+// CS1930: A range variable `v' may not be passes as `ref' or `out' parameter
+// Line: 19
+// Compiler options: -langversion:linq
+
+using System;
+using System.Linq;
+
+class C
+{
+       static int Foo (ref int value)
+       {
+               return 1;
+       }
+       
+       public static void Main ()
+       {
+               var e = from v in "a"
+                       let r = 1
+                       select Foo (ref v);
+       }
+}
diff --git a/mcs/errors/gcs1942-2.cs b/mcs/errors/gcs1942-2.cs
new file mode 100644 (file)
index 0000000..0ea535c
--- /dev/null
@@ -0,0 +1,21 @@
+// CS1942: Type inference failed to infer type argument for `select' clause. Try specifying the type argument explicitly
+// Line: 
+// Compiler options: -langversion:linq
+
+using System;
+
+class TestA
+{
+       public string Select<U> (Func<TestA, U> f)
+       {
+               return "";
+       }
+}
+
+public class C
+{
+       static void Main ()
+       {
+               string foo = from a in new TestA () select null;
+       }
+}
diff --git a/mcs/errors/gcs1942.cs b/mcs/errors/gcs1942.cs
new file mode 100644 (file)
index 0000000..25ca691
--- /dev/null
@@ -0,0 +1,15 @@
+// CS1942: Type inference failed to infer type argument for `select' clause. Try specifying the type argument explicitly
+// Line: 13
+// Compiler options: -langversion:linq
+
+using System;
+using System.Linq;
+
+class C
+{
+       public static void Main ()
+       {
+               var e = from values in "abcd"
+                       select null;
+       }
+}