diff options
author | Marek Safar <marek.safar@gmail.com> | 2009-06-24 15:34:25 +0400 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2009-06-24 15:34:25 +0400 |
commit | 1fd7e91289180a2d090df8f866dac73a6ff0b5f6 (patch) | |
tree | 11dc543f87670b2b092e052a46b6b9f25814affd /mcs/errors | |
parent | 021922567a270b744c2a7a7f4281accb70742c85 (diff) | |
parent | ef5b9248c9bc232054bda6ef900f0ecf0fe08a12 (diff) |
New tests.
svn path=/trunk/mcs/; revision=136766
Diffstat (limited to 'mcs/errors')
-rw-r--r-- | mcs/errors/cs0175-2.cs | 9 | ||||
-rw-r--r-- | mcs/errors/cs1525-13.cs (renamed from mcs/errors/cs0175.cs) | 6 | ||||
-rw-r--r-- | mcs/errors/cs1525-14.cs | 11 | ||||
-rw-r--r-- | mcs/errors/cs1644-13.cs | 15 | ||||
-rw-r--r-- | mcs/errors/cs1738-2.cs | 17 | ||||
-rw-r--r-- | mcs/errors/cs1738.cs | 15 | ||||
-rw-r--r-- | mcs/errors/gcs0853.cs | 18 | ||||
-rw-r--r-- | mcs/errors/gcs0854.cs | 18 |
8 files changed, 98 insertions, 11 deletions
diff --git a/mcs/errors/cs0175-2.cs b/mcs/errors/cs0175-2.cs deleted file mode 100644 index 3fabcb37732..00000000000 --- a/mcs/errors/cs0175-2.cs +++ /dev/null @@ -1,9 +0,0 @@ -// cs0175-2.cs: Use of keyword `base' is not valid in this context -// Line: 13 - -class DerivedClass { - public DerivedClass() { - base = null; - } -} - diff --git a/mcs/errors/cs0175.cs b/mcs/errors/cs1525-13.cs index 45782ee438e..cd091bc9c14 100644 --- a/mcs/errors/cs0175.cs +++ b/mcs/errors/cs1525-13.cs @@ -1,6 +1,8 @@ -// cs0175.cs: Use of keyword `base' is not valid in this context -// Line: 8 +// CS1525: Unexpected symbol `)', expecting `.', or `[' +// Line: 10 + using System.Collections; + class Collection : CollectionBase { public int Add (int x) diff --git a/mcs/errors/cs1525-14.cs b/mcs/errors/cs1525-14.cs new file mode 100644 index 00000000000..03f54690d41 --- /dev/null +++ b/mcs/errors/cs1525-14.cs @@ -0,0 +1,11 @@ +// CS1525: Unexpected symbol `=', expecting `.', or `[' +// Line: 8 + +class DerivedClass +{ + public DerivedClass () + { + base = null; + } +} + diff --git a/mcs/errors/cs1644-13.cs b/mcs/errors/cs1644-13.cs new file mode 100644 index 00000000000..3b9390e3536 --- /dev/null +++ b/mcs/errors/cs1644-13.cs @@ -0,0 +1,15 @@ +// CS1644: Feature `named argument' cannot be used because it is not part of the C# 3.0 language specification +// Line: 13 +// Compiler options: -langversion:3 + +public class C +{ + static void Foo (int i) + { + } + + public static void Main () + { + Foo (i : 3); + } +} diff --git a/mcs/errors/cs1738-2.cs b/mcs/errors/cs1738-2.cs new file mode 100644 index 00000000000..cd6838c3754 --- /dev/null +++ b/mcs/errors/cs1738-2.cs @@ -0,0 +1,17 @@ +// CS1738: Named arguments must appear after the positional arguments +// Line: 13 +// Compiler options: -langversion:future + +using System; + +class MyAttribute : Attribute +{ + public MyAttribute (string s, int value) + { + } +} + +[MyAttribute (s : "a", 1)] +class C +{ +} diff --git a/mcs/errors/cs1738.cs b/mcs/errors/cs1738.cs new file mode 100644 index 00000000000..e2a5ab57900 --- /dev/null +++ b/mcs/errors/cs1738.cs @@ -0,0 +1,15 @@ +// CS1738: Named arguments must appear after the positional arguments +// Line: 12 +// Compiler options: -langversion:future + +class C +{ + static void Foo (int a, string s) + { + } + + public static void Main () + { + Foo (a : 1, "out"); + } +} diff --git a/mcs/errors/gcs0853.cs b/mcs/errors/gcs0853.cs new file mode 100644 index 00000000000..83b7dd069ac --- /dev/null +++ b/mcs/errors/gcs0853.cs @@ -0,0 +1,18 @@ +// CS0853: An expression tree cannot contain named argument +// Line: 15 +// Compiler options: -langversion:future + +using System; +using System.Linq.Expressions; + +class M +{ + static void Named (int i) + { + } + + public static void Main () + { + Expression<Action> e = () => Named (i : 1); + } +} diff --git a/mcs/errors/gcs0854.cs b/mcs/errors/gcs0854.cs new file mode 100644 index 00000000000..fe15bdb2c8b --- /dev/null +++ b/mcs/errors/gcs0854.cs @@ -0,0 +1,18 @@ +// CS0854: An expression tree cannot contain an invocation which uses optional parameter +// Line: 15 +// Compiler options: -langversion:future + +using System; +using System.Linq.Expressions; + +class M +{ + static void Optional (int i, string s = "value") + { + } + + public static void Main () + { + Expression<Action> e = () => Optional (1); + } +} |