Browse Source

Add more tests

svn path=/trunk/mcs/; revision=1153
Miguel de Icaza 24 years ago
parent
commit
eeffa700cf
6 changed files with 58 additions and 0 deletions
  1. 10 0
      mcs/errors/cs0026-2.cs
  2. 8 0
      mcs/errors/cs0026.cs
  3. 8 0
      mcs/errors/cs0131.cs
  4. 9 0
      mcs/errors/cs0171.cs
  5. 15 0
      mcs/errors/cs0200.cs
  6. 8 0
      mcs/errors/cs1604.cs

+ 10 - 0
mcs/errors/cs0026-2.cs

@@ -0,0 +1,10 @@
+// cs0026: use of this is not allowed in a static field initializer
+// 
+class X {
+	static object o = this;
+
+	static int Main ()
+	{
+		return 1;
+	}
+}

+ 8 - 0
mcs/errors/cs0026.cs

@@ -0,0 +1,8 @@
+// cs0026: use of this is not allowed in static methods
+// Line: 6
+class X {
+	static void A ()
+	{
+		this = null;
+	}
+}

+ 8 - 0
mcs/errors/cs0131.cs

@@ -0,0 +1,8 @@
+// cs0131.cs: left hand side of an assignment must be variable, property access or indexer
+// Line:
+class X {
+	void A ()
+	{
+		5 = 4;
+	}
+}

+ 9 - 0
mcs/errors/cs0171.cs

@@ -0,0 +1,9 @@
+// cs0171.cs: field x must be initialized before constructor X ends.
+// Line: 
+class X {
+	public readonly int x;
+
+	X ()
+	{
+	}
+}

+ 15 - 0
mcs/errors/cs0200.cs

@@ -0,0 +1,15 @@
+// cs0200: can not assign to property X.P -- it is readonly
+// line: 12
+class X {
+	static int P {
+		get {
+			return 1;
+		}
+	}
+
+	static int Main ()
+	{
+		P = 10;
+		return 1;
+	}
+}

+ 8 - 0
mcs/errors/cs1604.cs

@@ -0,0 +1,8 @@
+// cs1604: Cannot assign to this
+// Line:
+class X {
+	void A ()
+	{
+		this = null;
+	}
+}