Author: marek
Date: 2007-08-14 11:43:54 -0400 (Tue, 14 Aug 2007)
New Revision: 84089
Added:
trunk/mcs/errors/cs1919.cs
trunk/mcs/errors/gcs0747-2.cs
trunk/mcs/errors/gcs0747.cs
trunk/mcs/errors/gcs1912.cs
trunk/mcs/errors/gcs1920.cs
trunk/mcs/errors/gcs1922.cs
trunk/mcs/errors/gcs1950.cs
trunk/mcs/errors/gcs1954.cs
Log:
New tests.
Added: trunk/mcs/errors/cs1919.cs
===================================================================
--- trunk/mcs/errors/cs1919.cs 2007-08-14 15:43:19 UTC (rev 84088)
+++ trunk/mcs/errors/cs1919.cs 2007-08-14 15:43:54 UTC (rev 84089)
@@ -0,0 +1,16 @@
+// CS1919: Unsafe type `int*' cannot be used in an object creation expression
+// Line: 12
+// Compiler options: -unsafe
+
+using System;
+
+public class Test
+{
+ static void Main ()
+ {
+ unsafe {
+ object o = new int*();
+ }
+ }
+}
+
Property changes on: trunk/mcs/errors/cs1919.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/mcs/errors/gcs0747-2.cs
===================================================================
--- trunk/mcs/errors/gcs0747-2.cs 2007-08-14 15:43:19 UTC (rev 84088)
+++ trunk/mcs/errors/gcs0747-2.cs 2007-08-14 15:43:54 UTC (rev 84089)
@@ -0,0 +1,18 @@
+// CS0747: Inconsistent `object initializer' member declaration
+// Line: 16
+// Compiler options: -langversion:linq
+
+using System;
+using System.Collections;
+
+class Data
+{
+}
+
+public class Test
+{
+ static void Main ()
+ {
+ var c = new ArrayList { Count = 1, 1 };
+ }
+}
Added: trunk/mcs/errors/gcs0747.cs
===================================================================
--- trunk/mcs/errors/gcs0747.cs 2007-08-14 15:43:19 UTC (rev 84088)
+++ trunk/mcs/errors/gcs0747.cs 2007-08-14 15:43:54 UTC (rev 84089)
@@ -0,0 +1,18 @@
+// CS0747: Inconsistent `collection initializer' member declaration
+// Line: 16
+// Compiler options: -langversion:linq
+
+using System;
+using System.Collections;
+
+class Data
+{
+}
+
+public class Test
+{
+ static void Main ()
+ {
+ var c = new ArrayList { 1, Count = 1 };
+ }
+}
Property changes on: trunk/mcs/errors/gcs0747.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/mcs/errors/gcs1912.cs
===================================================================
--- trunk/mcs/errors/gcs1912.cs 2007-08-14 15:43:19 UTC (rev 84088)
+++ trunk/mcs/errors/gcs1912.cs 2007-08-14 15:43:54 UTC (rev 84089)
@@ -0,0 +1,19 @@
+// CS1912: An object initializer includes more than one member `Count'
initialization
+// Line: 17
+// Compiler options: -langversion:linq
+
+using System;
+using System.Collections.Generic;
+
+public class Test
+{
+ class Container
+ {
+ public int Count;
+ }
+
+ static void Main ()
+ {
+ var c = new Container { Count = 1, Count = 10 };
+ }
+}
Property changes on: trunk/mcs/errors/gcs1912.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/mcs/errors/gcs1920.cs
===================================================================
--- trunk/mcs/errors/gcs1920.cs 2007-08-14 15:43:19 UTC (rev 84088)
+++ trunk/mcs/errors/gcs1920.cs 2007-08-14 15:43:54 UTC (rev 84089)
@@ -0,0 +1,13 @@
+// CS1920: An element initializer cannot be empty
+// Line: 11
+// Compiler options: -langversion:linq
+
+using System.Collections.Generic;
+
+public class Test
+{
+ static void Main ()
+ {
+ var d = new Dictionary <string, int> { { } };
+ }
+}
Property changes on: trunk/mcs/errors/gcs1920.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/mcs/errors/gcs1922.cs
===================================================================
--- trunk/mcs/errors/gcs1922.cs 2007-08-14 15:43:19 UTC (rev 84088)
+++ trunk/mcs/errors/gcs1922.cs 2007-08-14 15:43:54 UTC (rev 84089)
@@ -0,0 +1,18 @@
+// CS1922: A field or property `Data.Value' cannot be initialized with a
collection object initializer because type `int' does not implement
`System.Collections.IEnumerable' interface
+// Line: 16
+// Compiler options: -langversion:linq
+
+using System;
+
+class Data
+{
+ public int Value;
+}
+
+public class Test
+{
+ static void Main ()
+ {
+ var c = new Data { Value = { 0, 1, 2 } };
+ }
+}
Property changes on: trunk/mcs/errors/gcs1922.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/mcs/errors/gcs1950.cs
===================================================================
--- trunk/mcs/errors/gcs1950.cs 2007-08-14 15:43:19 UTC (rev 84088)
+++ trunk/mcs/errors/gcs1950.cs 2007-08-14 15:43:54 UTC (rev 84089)
@@ -0,0 +1,23 @@
+// CS1954: The best overloaded collection initalizer method
`Data.Add(__arglist)' has some invalid arguments
+// Line: 16
+// Compiler options: -langversion:linq
+
+using System;
+using System.Collections;
+
+class Data : IEnumerable
+{
+ public IEnumerator GetEnumerator () { return null; }
+
+ public void Add (__arglist)
+ {
+ }
+}
+
+public class Test
+{
+ static void Main ()
+ {
+ var c = new Data { 1 };
+ }
+}
Property changes on: trunk/mcs/errors/gcs1950.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/mcs/errors/gcs1954.cs
===================================================================
--- trunk/mcs/errors/gcs1954.cs 2007-08-14 15:43:19 UTC (rev 84088)
+++ trunk/mcs/errors/gcs1954.cs 2007-08-14 15:43:54 UTC (rev 84089)
@@ -0,0 +1,23 @@
+// CS1954: The best overloaded collection initalizer method `Data.Add(ref
int)' cannot have 'ref', or `out' modifier
+// Line: 16
+// Compiler options: -langversion:linq
+
+using System;
+using System.Collections;
+
+class Data : IEnumerable
+{
+ public IEnumerator GetEnumerator () { return null; }
+
+ public void Add (ref int b)
+ {
+ }
+}
+
+public class Test
+{
+ static void Main ()
+ {
+ var c = new Data { 1 };
+ }
+}
Property changes on: trunk/mcs/errors/gcs1954.cs
___________________________________________________________________
Name: svn:eol-style
+ native
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches