From 434a21d3fd3fcd35c0874cfac3c3c9fd1434ec81 Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Sun, 28 Dec 2008 14:44:13 +0000 Subject: [PATCH] New tests. svn path=/trunk/mcs/; revision=122158 --- mcs/errors/gcs1931-4.cs | 15 +++++++++++++++ mcs/errors/gcs1940.cs | 23 +++++++++++++++++++++++ mcs/errors/gcs1942-2.cs | 5 ++--- mcs/errors/gcs1942.cs | 5 ++--- mcs/errors/gcs1943.cs | 14 ++++++++++++++ 5 files changed, 56 insertions(+), 6 deletions(-) create mode 100644 mcs/errors/gcs1931-4.cs create mode 100644 mcs/errors/gcs1940.cs create mode 100644 mcs/errors/gcs1943.cs diff --git a/mcs/errors/gcs1931-4.cs b/mcs/errors/gcs1931-4.cs new file mode 100644 index 00000000000..6088435221f --- /dev/null +++ b/mcs/errors/gcs1931-4.cs @@ -0,0 +1,15 @@ +// CS1931: A range variable `i' conflicts with a previous declaration of `i' +// Line: 12 + +using System; +using System.Linq; + +class C +{ + public static void Main () + { + int i = 9; + var e = from i in "a" + select 1; + } +} diff --git a/mcs/errors/gcs1940.cs b/mcs/errors/gcs1940.cs new file mode 100644 index 00000000000..e53a5a6b98c --- /dev/null +++ b/mcs/errors/gcs1940.cs @@ -0,0 +1,23 @@ +// CS1940: Ambiguous implementation of the query pattern `Select' for source type `Multiple' +// Line: 10 + +class Multiple +{ + delegate int D1 (int x); + delegate int D2 (int x); + + int Select (D1 d) + { + return 0; + } + + int Select (D2 d) + { + return 1; + } + + public static void Main () + { + var q = from x in new Multiple () select x; + } +} diff --git a/mcs/errors/gcs1942-2.cs b/mcs/errors/gcs1942-2.cs index 6a770867c4b..f67f376da67 100644 --- a/mcs/errors/gcs1942-2.cs +++ b/mcs/errors/gcs1942-2.cs @@ -1,6 +1,5 @@ -// CS1942: Type inference failed to infer type argument for `select' clause. Try specifying the type argument explicitly -// Line: - +// CS1942: An expression type in `select' clause is incorrect. Type inference failed in the call to `Select' +// Line: 18 using System; diff --git a/mcs/errors/gcs1942.cs b/mcs/errors/gcs1942.cs index 9f2250bee86..e6cffda8210 100644 --- a/mcs/errors/gcs1942.cs +++ b/mcs/errors/gcs1942.cs @@ -1,6 +1,5 @@ -// CS1942: Type inference failed to infer type argument for `select' clause. Try specifying the type argument explicitly -// Line: 13 - +// CS1942: An expression type in `select' clause is incorrect. Type inference failed in the call to `Select' +// Line: 12 using System; using System.Linq; diff --git a/mcs/errors/gcs1943.cs b/mcs/errors/gcs1943.cs new file mode 100644 index 00000000000..92fd5914608 --- /dev/null +++ b/mcs/errors/gcs1943.cs @@ -0,0 +1,14 @@ +// CS1943: An expression type is incorrect in a subsequent `from' clause in a query expression with source type `string' +// Line: 11 + +using System.Linq; + +class Test +{ + static void Main () + { + var e = from a in "abcd" + from b in new Test () + select b; + } +} -- 2.25.1