Author: marek
Date: 2005-03-15 06:36:52 -0500 (Tue, 15 Mar 2005)
New Revision: 41830
Added:
trunk/mcs/errors/cs0157-5.cs
trunk/mcs/errors/cs0165-4.cs
trunk/mcs/errors/cs0165-5.cs
trunk/mcs/errors/cs0170-2.cs
trunk/mcs/errors/cs0177-2.cs
trunk/mcs/errors/cs0177-3.cs
trunk/mcs/errors/cs0177-4.cs
trunk/mcs/errors/cs0188-2.cs
trunk/mcs/errors/cs0266-3.cs
trunk/mcs/errors/cs0269.cs
trunk/mcs/errors/cs0623.cs
trunk/mcs/errors/cs1527-3.cs
trunk/mcs/errors/cs1604.cs
trunk/mcs/errors/cs1625-2.cs
trunk/mcs/errors/cs1626-2.cs
Removed:
trunk/mcs/errors/cs0610-4.cs
trunk/mcs/errors/error-1.cs
trunk/mcs/errors/error-2.cs
trunk/mcs/errors/error-3.cs
trunk/mcs/errors/error-5.cs
trunk/mcs/errors/error-6.cs
trunk/mcs/errors/fail
trunk/mcs/errors/syntax0068.cs
trunk/mcs/errors/syntax0069.cs
trunk/mcs/errors/syntax0071.cs
trunk/mcs/errors/syntax0116.cs
Modified:
trunk/mcs/errors/mcs-expect-no-error
trunk/mcs/errors/mcs-expect-wrong-error
Log:
New tests + updated wrong (need to flush before it become chaotic)
Removed obsole tests.
Added: trunk/mcs/errors/cs0157-5.cs
===================================================================
--- trunk/mcs/errors/cs0157-5.cs 2005-03-15 08:19:50 UTC (rev 41829)
+++ trunk/mcs/errors/cs0157-5.cs 2005-03-15 11:36:52 UTC (rev 41830)
@@ -0,0 +1,18 @@
+// cs0157-5.cs: Control can not leave the body of a finally clause
+// Line: 12
+
+class T {
+ static void Main ()
+ {
+ while (true) {
+ try {
+ System.Console.WriteLine ("trying");
+ } finally {
+ try {
+ break;
+ }
+ catch {}
+ }
+ }
+ }
+}
\ No newline at end of file
Added: trunk/mcs/errors/cs0165-4.cs
===================================================================
--- trunk/mcs/errors/cs0165-4.cs 2005-03-15 08:19:50 UTC (rev 41829)
+++ trunk/mcs/errors/cs0165-4.cs 2005-03-15 11:36:52 UTC (rev 41830)
@@ -0,0 +1,17 @@
+// cs0165.cs: Use of unassigned local variable
+// Line: 9
+
+class C {
+ public static int test4 ()
+ {
+ int a;
+
+ try {
+ a = 3;
+ } catch {
+ }
+
+ // CS0165
+ return a;
+ }
+}
Added: trunk/mcs/errors/cs0165-5.cs
===================================================================
--- trunk/mcs/errors/cs0165-5.cs 2005-03-15 08:19:50 UTC (rev 41829)
+++ trunk/mcs/errors/cs0165-5.cs 2005-03-15 11:36:52 UTC (rev 41830)
@@ -0,0 +1,23 @@
+// cs0165.cs: Use of unassigned local variable
+// Line: 9
+
+using System;
+
+class C {
+ public static int test5 ()
+ {
+ int a;
+
+ try {
+ Console.WriteLine ("TRY");
+ a = 8;
+ } catch {
+ a = 9;
+ } finally {
+ // CS0165
+ Console.WriteLine (a);
+ }
+
+ return a;
+ }
+}
Added: trunk/mcs/errors/cs0170-2.cs
===================================================================
--- trunk/mcs/errors/cs0170-2.cs 2005-03-15 08:19:50 UTC (rev 41829)
+++ trunk/mcs/errors/cs0170-2.cs 2005-03-15 11:36:52 UTC (rev 41830)
@@ -0,0 +1,14 @@
+// CS0170: Use of possibly unassigned field `c'
+// Line: 11
+
+struct A
+{
+ private long b;
+ private float c;
+
+ public A (int foo)
+ {
+ b = (long) c;
+ c = 1;
+ }
+}
\ No newline at end of file
Added: trunk/mcs/errors/cs0177-2.cs
===================================================================
--- trunk/mcs/errors/cs0177-2.cs 2005-03-15 08:19:50 UTC (rev 41829)
+++ trunk/mcs/errors/cs0177-2.cs 2005-03-15 11:36:52 UTC (rev 41830)
@@ -0,0 +1,14 @@
+// cs0177.cs: The out parameter 'display' must be assigned to before control
leaves the current method
+// Line: 5
+
+class ClassMain {
+ public static void test2 (int a, out float f)
+ {
+ // CS0177
+ if (a == 5)
+ return;
+
+ f = 8.53F;
+ }
+}
+
Added: trunk/mcs/errors/cs0177-3.cs
===================================================================
--- trunk/mcs/errors/cs0177-3.cs 2005-03-15 08:19:50 UTC (rev 41829)
+++ trunk/mcs/errors/cs0177-3.cs 2005-03-15 11:36:52 UTC (rev 41830)
@@ -0,0 +1,14 @@
+// cs0177.cs: The out parameter 'f' must be assigned to before control leaves
the current method
+// Line: 5
+
+class C {
+ public static void test3 (out float f)
+ {
+ try {
+ f = 8.53F;
+ } catch {
+ return;
+ }
+ }
+}
+
Added: trunk/mcs/errors/cs0177-4.cs
===================================================================
--- trunk/mcs/errors/cs0177-4.cs 2005-03-15 08:19:50 UTC (rev 41829)
+++ trunk/mcs/errors/cs0177-4.cs 2005-03-15 11:36:52 UTC (rev 41830)
@@ -0,0 +1,19 @@
+// cs0177.cs: The out parameter 'f' must be assigned to before control leaves
the current method
+// Line: 5
+
+class C {
+ public static void test (int a, out float f)
+ {
+ do {
+ // CS0177
+ if (a == 8) {
+ System.Console.WriteLine ("Hello");
+ return;
+ }
+ } while (false);
+
+ f = 1.3F;
+ return;
+ }
+}
+
Added: trunk/mcs/errors/cs0188-2.cs
===================================================================
--- trunk/mcs/errors/cs0188-2.cs 2005-03-15 08:19:50 UTC (rev 41829)
+++ trunk/mcs/errors/cs0188-2.cs 2005-03-15 11:36:52 UTC (rev 41830)
@@ -0,0 +1,16 @@
+// cs0188.cs: The this object cannot be used before all of its fields are
assigned to
+// Line: 10
+
+struct B
+{
+ public int a;
+
+ public B (int foo)
+ {
+ Test ();
+ }
+
+ public void Test ()
+ {
+ }
+}
\ No newline at end of file
Added: trunk/mcs/errors/cs0266-3.cs
===================================================================
--- trunk/mcs/errors/cs0266-3.cs 2005-03-15 08:19:50 UTC (rev 41829)
+++ trunk/mcs/errors/cs0266-3.cs 2005-03-15 11:36:52 UTC (rev 41830)
@@ -0,0 +1,14 @@
+// cs0266.cs: Cannot implicitly convert type 'object' to
'System.Collections.ArrayList'. An explicit conversion exists (are you missing
a cast?)
+// Line: 10
+
+using System.Collections;
+
+class X
+{
+ static Hashtable h = new Hashtable ();
+
+ public static void Main ()
+ {
+ ArrayList l = h ["hola"] = new ArrayList ();
+ }
+}
Added: trunk/mcs/errors/cs0269.cs
===================================================================
--- trunk/mcs/errors/cs0269.cs 2005-03-15 08:19:50 UTC (rev 41829)
+++ trunk/mcs/errors/cs0269.cs 2005-03-15 11:36:52 UTC (rev 41830)
@@ -0,0 +1,24 @@
+// cs0269.cs: Use of unassigned out parameter 'a'
+// Line: 23
+
+struct A
+{
+ public int a;
+ public A (int foo)
+ {
+ a = foo;
+ }
+}
+
+class X
+{
+ static void test_output (A a)
+ {
+ }
+
+ static void test5 (out A a)
+ {
+ test_output (a);
+ a = new A (5);
+ }
+}
Deleted: trunk/mcs/errors/cs0610-4.cs
===================================================================
--- trunk/mcs/errors/cs0610-4.cs 2005-03-15 08:19:50 UTC (rev 41829)
+++ trunk/mcs/errors/cs0610-4.cs 2005-03-15 11:36:52 UTC (rev 41830)
@@ -1,6 +0,0 @@
-// cs0610.cs: Field or property cannot be of type 'System.TypedReference'
-// Line: 5
-
-public class Sample {
- event System.TypedReference reference;
-}
\ No newline at end of file
Added: trunk/mcs/errors/cs0623.cs
===================================================================
--- trunk/mcs/errors/cs0623.cs 2005-03-15 08:19:50 UTC (rev 41829)
+++ trunk/mcs/errors/cs0623.cs 2005-03-15 11:36:52 UTC (rev 41830)
@@ -0,0 +1,8 @@
+// cs0623.cs: Array initializers can only be used in a variable or field
initializer. Try using a new expression instead
+// Line: 7
+
+class C
+{
+ public int[] a = { 2, {1} };
+}
+
\ No newline at end of file
Added: trunk/mcs/errors/cs1527-3.cs
===================================================================
--- trunk/mcs/errors/cs1527-3.cs 2005-03-15 08:19:50 UTC (rev 41829)
+++ trunk/mcs/errors/cs1527-3.cs 2005-03-15 11:36:52 UTC (rev 41830)
@@ -0,0 +1,5 @@
+// cs1527.cs: Namespace elements cannot be explicitly declared as private,
protected, or protected internal
+// Line: 4
+
+protected internal enum E {
+}
Added: trunk/mcs/errors/cs1604.cs
===================================================================
--- trunk/mcs/errors/cs1604.cs 2005-03-15 08:19:50 UTC (rev 41829)
+++ trunk/mcs/errors/cs1604.cs 2005-03-15 11:36:52 UTC (rev 41830)
@@ -0,0 +1,10 @@
+// cs1604.cs: Cannot assign to 'this' because it is read-only
+// Line: 8
+
+class C
+{
+ public void Main ()
+ {
+ this = null;
+ }
+}
\ No newline at end of file
Added: trunk/mcs/errors/cs1625-2.cs
===================================================================
--- trunk/mcs/errors/cs1625-2.cs 2005-03-15 08:19:50 UTC (rev 41829)
+++ trunk/mcs/errors/cs1625-2.cs 2005-03-15 11:36:52 UTC (rev 41830)
@@ -0,0 +1,20 @@
+// CS1625: Cannot yield in the body of a finally clause
+// Line: 16
+
+using System;
+using System.Collections;
+
+class X
+{
+ public static IEnumerable Test (int a)
+ {
+ try {
+ ;
+ } finally {
+ try {
+ yield return 0;
+ }
+ finally {}
+ }
+ }
+}
Added: trunk/mcs/errors/cs1626-2.cs
===================================================================
--- trunk/mcs/errors/cs1626-2.cs 2005-03-15 08:19:50 UTC (rev 41829)
+++ trunk/mcs/errors/cs1626-2.cs 2005-03-15 11:36:52 UTC (rev 41830)
@@ -0,0 +1,19 @@
+// cs01626.cs: Cannot yield a value in the body of a try block with a catch
clause
+// Line: 11
+
+using System.Collections;
+
+class C: IEnumerable
+{
+ public IEnumerator GetEnumerator ()
+ {
+ try {
+ try {
+ yield return this;
+ }
+ finally {}
+ }
+ catch (System.Exception) {
+ }
+ }
+}
Deleted: trunk/mcs/errors/error-1.cs
===================================================================
--- trunk/mcs/errors/error-1.cs 2005-03-15 08:19:50 UTC (rev 41829)
+++ trunk/mcs/errors/error-1.cs 2005-03-15 11:36:52 UTC (rev 41830)
@@ -1,93 +0,0 @@
-// This test must produce a compilation error in each method.
-using System;
-
-public class X
-{
- public static int Main ()
- {
- // This is a compilation-only test.
- return 0;
- }
-
- // Must assign out parameter.
- // CS0177
- public static void test1 (out float f)
- {
- }
-
- // Must assign it before returning.
- public static void test2 (int a, out float f)
- {
- // CS0177
- if (a == 5)
- return;
-
- f = 8.53F;
- }
-
- // CS0177
- public static void test3 (out float f)
- {
- try {
- f = 8.53F;
- } catch {
- return;
- }
- }
-
- public static int test4 ()
- {
- int a;
-
- try {
- a = 3;
- } catch {
- Console.WriteLine ("EXCEPTION");
- }
-
- // CS0165
- return a;
- }
-
- public static int test5 ()
- {
- int a;
-
- try {
- Console.WriteLine ("TRY");
- a = 8;
- } catch {
- a = 9;
- } finally {
- // CS0165
- Console.WriteLine (a);
- }
-
- return a;
- }
-
- public static void test6 (int a, out float f)
- {
- do {
- // CS0177
- if (a == 8) {
- Console.WriteLine ("Hello");
- return;
- }
- } while (false);
-
- f = 1.3F;
- return;
- }
-
- // CS0177
- public static void test7 (out float f)
- {
- goto World;
- // warning CS0162
- f = 8.0F;
-
- World:
- ;
- }
-}
Deleted: trunk/mcs/errors/error-2.cs
===================================================================
--- trunk/mcs/errors/error-2.cs 2005-03-15 08:19:50 UTC (rev 41829)
+++ trunk/mcs/errors/error-2.cs 2005-03-15 11:36:52 UTC (rev 41830)
@@ -1,106 +0,0 @@
-class Internal { }
-
-public class Public { }
-
-interface InternalInterface { }
-
-class X
-{
- public class NestedPublic { }
-
- internal class NestedAssembly { }
-
- protected internal class NestedFamilyAndAssembly { }
-
- protected class NestedFamily { }
-
- protected class NestedPrivate { }
-
- static void Main () { }
-}
-
-// CS0060
-public class A : Internal { }
-
-// CS0060
-public class B : X.NestedPublic { }
-// CS0060
-public class C : X.NestedAssembly { }
-// CS0060
-public class D : X.NestedFamilyAndAssembly { }
-
-// CS0059
-public delegate void E (Internal i);
-// CS0058
-public delegate Internal F ();
-
-public class Y
-{
- // CS0060
- public class YA : Internal { }
- // CS0060
- public class YB : X.NestedPublic { }
- // CS0060
- public class YC : X.NestedAssembly { }
- // CS0060
- public class YD : X.NestedFamilyAndAssembly { }
-
- // CS0051
- public void YMA (Internal a) { }
- // CS0051
- public void YMB (X.NestedPublic a) { }
- // CS0051
- public void YMC (X.NestedAssembly a) { }
- // CS0051
- public void YMD (X.NestedFamilyAndAssembly a) { }
-
- // CS0050
- public Internal YME () { }
-
- // CS0052
- public Internal YE;
-
- // CS0053
- public Internal YF {
- get { return null; }
- }
-
- // CS0054
- public Internal this [int a] {
- get { return null; }
- }
-
- // CS0052
- public event Internal YG;
-
- // CS0055
- public int this [Internal i] {
- get { return; }
- }
-}
-
-class Z : X
-{
- // CS0060
- public class ZA : NestedFamily { }
- // CS0060
- internal class ZB : NestedFamily { }
-}
-
-internal interface L
-{
- void Hello (string hello);
-}
-
-// CS0061
-public interface M : L
-{
- void World (string world);
-}
-
-public class N : M
-{
- public void Hello (string hello) { }
-
- public void World (string world) { }
-}
Deleted: trunk/mcs/errors/error-3.cs
===================================================================
--- trunk/mcs/errors/error-3.cs 2005-03-15 08:19:50 UTC (rev 41829)
+++ trunk/mcs/errors/error-3.cs 2005-03-15 11:36:52 UTC (rev 41830)
@@ -1,83 +0,0 @@
-using System;
-
-struct A
-{
- public int a;
- private long b;
- private float c;
-
- public A (int foo)
- // CS0171
- {
- a = foo;
- // CS0170
- b = (long) c;
- }
-}
-
-struct B
-{
- public int a;
-
- public B (int foo)
- {
- // CS0188
- Test ();
- }
-
- public void Test ()
- {
- Console.WriteLine (a);
- }
-}
-
-class X
-{
- // CS0177
- static void test1 (out A a)
- {
- a.a = 5;
- }
-
- static void test_output (A a)
- {
- }
-
- static void test2 ()
- {
- A a;
-
- // CS0165
- test_output (a);
- }
-
- static void test3 ()
- {
- A a;
-
- a.a = 5;
- // CS0165
- test_output (a);
- }
-
- static void test4 ()
- {
- A a;
-
- // CS0170
- Console.WriteLine (a.a);
- }
-
- static void test5 (out A a)
- {
- // CS0165
- test_output (a);
- a = new A (5);
- }
-
- public static int Main ()
- {
- // Compilation-only test.
- return 0;
- }
-}
Deleted: trunk/mcs/errors/error-5.cs
===================================================================
--- trunk/mcs/errors/error-5.cs 2005-03-15 08:19:50 UTC (rev 41829)
+++ trunk/mcs/errors/error-5.cs 2005-03-15 11:36:52 UTC (rev 41830)
@@ -1,18 +0,0 @@
-// The event access is illegal and it should bail out
-
-using System;
-
-delegate void MyEventHandler();
-
-class MyEvent {
- public event MyEventHandler SomeEvent;
-}
-
-class EventDemo {
-
- public static void Main(){
- MyEvent evt = new MyEvent();
- // CS0070
- evt.SomeEvent();
- }
-}
Deleted: trunk/mcs/errors/error-6.cs
===================================================================
--- trunk/mcs/errors/error-6.cs 2005-03-15 08:19:50 UTC (rev 41829)
+++ trunk/mcs/errors/error-6.cs 2005-03-15 11:36:52 UTC (rev 41830)
@@ -1,12 +0,0 @@
-using System.Collections;
-
-class X
-{
- static Hashtable h = new Hashtable ();
-
- public static void Main ()
- {
- // CS0029
- ArrayList l = h ["hola"] = new ArrayList ();
- }
-}
Deleted: trunk/mcs/errors/fail
===================================================================
--- trunk/mcs/errors/fail 2005-03-15 08:19:50 UTC (rev 41829)
+++ trunk/mcs/errors/fail 2005-03-15 11:36:52 UTC (rev 41830)
@@ -1,30 +0,0 @@
-The following tests failed:
-
-cs0051.cs: We don't complain about inconsistent accessibility.
-cs0060.cs: We don't complain about inconsistent accessibility.
-cs0108.cs: We should re-enable the test code in the compiler
-cs0110.cs: Stack overflow in the compiler
-cs0111.cs: We don't complain about second occurance of method definition.
-cs0118.cs: We report the error, but the CSC error gives more information.
-cs0136.cs: Similar error reported (reuse of variable name, 128)
-cs0136-2.cs: Similar error reported (reuse of variable name, 128)
-cs0164.cs: We dont emit the warning for an unused label
-cs0165.cs: We need data flow analysis
-cs0165-2.cs: We need data flow analysis
-cs0171.cs: We do not track unassigned struct fields on struct constructors
-cs0216.cs: We do not report missing operators.
-cs0234.cs: Will be hard to fix;
-cs0255.cs: Error isn't flagged.
-cs0523.cs: Error isn't flagged.
-cs0529.cs: We get error CS0146 instead
-cs0654.cs: Compiler crash
-cs1001.cs: Compiler emits syntax error; Its ok.
-cs1513.cs: Syntax error; We could provide better message
-cs1518.cs: Syntax error; We could provide better message
-cs1525.cs: Syntax error; We could provide better message
-cs1528.cs: Syntax error; We could provide better message
-cs1529.cs: Syntax error; We could provide better message
-cs1552.cs: Syntax error; We could provide better message
-cs1604.cs: Error isn't flagged.
-cs-20.cs: Attribute error isn't flagged
-
Modified: trunk/mcs/errors/mcs-expect-no-error
===================================================================
--- trunk/mcs/errors/mcs-expect-no-error 2005-03-15 08:19:50 UTC (rev
41829)
+++ trunk/mcs/errors/mcs-expect-no-error 2005-03-15 11:36:52 UTC (rev
41830)
@@ -10,6 +10,7 @@
cs0029-3.cs
cs0035.cs
cs0121-3.cs
+cs0157-5.cs
cs0186.cs
cs0229.cs
cs0266-2.cs
Modified: trunk/mcs/errors/mcs-expect-wrong-error
===================================================================
--- trunk/mcs/errors/mcs-expect-wrong-error 2005-03-15 08:19:50 UTC (rev
41829)
+++ trunk/mcs/errors/mcs-expect-wrong-error 2005-03-15 11:36:52 UTC (rev
41830)
@@ -20,8 +20,9 @@
cs0201.cs
cs0208-3.cs
cs0229-2.cs
+cs0245.cs
cs0266.cs
-cs0407.cs
+cs0266-3.cs
cs0428.cs
cs0525.cs
cs0526.cs
@@ -43,6 +44,7 @@
cs1518.cs
cs1525.cs
cs1527-2.cs
+cs1527-3.cs
cs1528.cs
cs1535.cs
cs1552.cs
@@ -50,17 +52,12 @@
cs1605.cs
cs1615.cs
cs1620.cs
-cs1622.cs
+cs1625-2.cs
+cs1626-2.cs
cs1626.cs
cs1638.cs
cs1641.cs
cs1656.cs
cs1657.cs
cs1666.cs
-cs1715.cs
cs2007.cs
-
-cs3021.cs
-cs3022.cs
-cs3023.cs
-
Deleted: trunk/mcs/errors/syntax0068.cs
===================================================================
--- trunk/mcs/errors/syntax0068.cs 2005-03-15 08:19:50 UTC (rev 41829)
+++ trunk/mcs/errors/syntax0068.cs 2005-03-15 11:36:52 UTC (rev 41830)
@@ -1,15 +0,0 @@
-// cs0068.cs: Event in interface can't have initializer.
-// Line: 14
-
-using System;
-
-class ErrorCS0068 {
- public delegate void FooHandler ();
- public void method () {}
- public static void Main () {
- }
-}
-
-interface IFoo {
- event ErrorCS0068.FooHandler OnFoo = new ErrorCS0068.FooHandler
(ErrorCS0068.method);
-}
Deleted: trunk/mcs/errors/syntax0069.cs
===================================================================
--- trunk/mcs/errors/syntax0069.cs 2005-03-15 08:19:50 UTC (rev 41829)
+++ trunk/mcs/errors/syntax0069.cs 2005-03-15 11:36:52 UTC (rev 41830)
@@ -1,18 +0,0 @@
-// cs0069.cs: Event cannot have add or remove accessors in an interface.
-// Line: 13
-
-using System;
-
-class ErrorCS0069 {
- public delegate void FooHandler ();
- public static void Main () {
- }
-}
-
-interface IBar {
- event OnFoo {
- add { }
- remove { }
- }
-}
-
Deleted: trunk/mcs/errors/syntax0071.cs
===================================================================
--- trunk/mcs/errors/syntax0071.cs 2005-03-15 08:19:50 UTC (rev 41829)
+++ trunk/mcs/errors/syntax0071.cs 2005-03-15 11:36:52 UTC (rev 41830)
@@ -1,17 +0,0 @@
-// cs0071.cs: An explicit implementation of an event must use property syntax.
-// Line: 13
-
-using System;
-
-public delegate void Foo (object source);
-
-interface IFoo {
- event Foo OnFoo;
-}
-
-class ErrorCS0071 : IFoo {
- event Foo IFoo.OnFoo () { }
- public static void Main () {
- }
-}
-
Deleted: trunk/mcs/errors/syntax0116.cs
===================================================================
--- trunk/mcs/errors/syntax0116.cs 2005-03-15 08:19:50 UTC (rev 41829)
+++ trunk/mcs/errors/syntax0116.cs 2005-03-15 11:36:52 UTC (rev 41830)
@@ -1,7 +0,0 @@
-// cs0116.cs: A namespace cant have members that dont correspond to a class,
delegate, interface, union, struct or enum.
-// Line: 6
-
-namespace Bar
-{
- float a;
-}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches