New tests based on bug #80368
authorMarek Safar <marek.safar@gmail.com>
Sun, 14 Jan 2007 14:27:33 +0000 (14:27 -0000)
committerMarek Safar <marek.safar@gmail.com>
Sun, 14 Jan 2007 14:27:33 +0000 (14:27 -0000)
svn path=/trunk/mcs/; revision=70979

25 files changed:
mcs/errors/cs0072-2.cs
mcs/errors/cs0072.cs
mcs/errors/cs0111-18.cs [new file with mode: 0644]
mcs/errors/cs0114-2.cs [new file with mode: 0644]
mcs/errors/cs0115-2.cs
mcs/errors/cs0115-3.cs
mcs/errors/cs0115-4.cs
mcs/errors/cs0115-6.cs [new file with mode: 0644]
mcs/errors/cs0115.cs
mcs/errors/cs0179-2.cs [new file with mode: 0644]
mcs/errors/cs0179-3.cs [new file with mode: 0644]
mcs/errors/cs0266-14.cs
mcs/errors/cs0505-2.cs [new file with mode: 0644]
mcs/errors/cs0505-3.cs [new file with mode: 0644]
mcs/errors/cs0506-2.cs [new file with mode: 0644]
mcs/errors/cs0507-3.cs [new file with mode: 0644]
mcs/errors/cs0533-2.cs [new file with mode: 0644]
mcs/errors/cs0534-5.cs [new file with mode: 0644]
mcs/errors/cs0626-2.cs
mcs/errors/cs0626-3.cs
mcs/errors/cs0626-4.cs
mcs/errors/cs0626-5.cs [new file with mode: 0644]
mcs/errors/cs0626.cs
mcs/errors/cs0672-4.cs [new file with mode: 0644]
mcs/errors/cs1715-2.cs [new file with mode: 0644]

index 84e0aedc00b7152d0d0846cfae215cce80128a49..f4fa39d60e9c681cdac5cc8741c0c1779dc8cb9d 100644 (file)
@@ -1,4 +1,4 @@
-// cs0072-2.cs: Event `Child.OnFoo' can override only event
+// CS0072: `Child.OnFoo': cannot override because `ErrorCS0072.OnFoo()' is not an event
 // Line: 16
 
 using System;
index 0e7c4619a6d5bbf7de6dfb2623931134135bd2e0..29481812a8c74c8732a1d566747fa4aaed9c5b88 100644 (file)
@@ -1,4 +1,4 @@
-// cs0072.cs: Event `Child.OnFoo' can override only event
+// CS0072: `Child.OnFoo': cannot override because `ErrorCS0072.OnFoo()' is not an event
 // Line: 16
 
 using System;
diff --git a/mcs/errors/cs0111-18.cs b/mcs/errors/cs0111-18.cs
new file mode 100644 (file)
index 0000000..7914344
--- /dev/null
@@ -0,0 +1,8 @@
+// CS0111: `C.this[int[]]' is already defined. Rename this member or use different parameter types
+// Line: 6
+
+class C
+{
+    bool this [int[] i] { get { return true; } }
+    bool this [params int[] i] { get { return false; } }
+}
diff --git a/mcs/errors/cs0114-2.cs b/mcs/errors/cs0114-2.cs
new file mode 100644 (file)
index 0000000..515d077
--- /dev/null
@@ -0,0 +1,13 @@
+// CS0114: `B.MyEvent' hides inherited member `A.MyEvent'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword
+// Line: 12
+// Compiler options: -warnaserror -warn:2
+
+using System;
+
+abstract class A {
+       public abstract event EventHandler MyEvent;
+}
+
+class B : A {
+       public event EventHandler MyEvent;
+}
index 69030205241d4ce45502e9a2dd5de307c65ea2e2..a7f16152a9a7a1a1455efdc1c95a61ea0cf486b1 100644 (file)
@@ -1,4 +1,4 @@
-// cs0115.cs: `X.this[int]': no suitable method found to override
+// CS0115: `X.this[int]' is marked as an override but no suitable indexer found to override
 // Line: 5
 
 class X {
index 5e1c80dc3ec6df2e91069349a29d74bbfc412044..ec73c838dabf175290fd560e58c004be49c48d11 100644 (file)
@@ -1,4 +1,4 @@
-// cs0115-3.cs: `MyTestExtended.GetName()': no suitable method found to override
+// CS0115: `MyTestExtended.GetName()' is marked as an override but no suitable method found to override
 // Line: 12
 // Compiler options: -r:CS0534-4-lib.dll
 
index b7717e4db99e1b15ddfd5e9909d8e31b390ec3d6..906f82061d5fed425e207e8e8c854415e556d901 100644 (file)
@@ -1,4 +1,4 @@
-// cs0115-4.cs: `DerivedClass.get_Value()': no suitable method found to override
+// CS0115: `DerivedClass.get_Value()' is marked as an override but no suitable method found to override
 // Line: 13
 
 class BaseClass {
diff --git a/mcs/errors/cs0115-6.cs b/mcs/errors/cs0115-6.cs
new file mode 100644 (file)
index 0000000..d4bc2b8
--- /dev/null
@@ -0,0 +1,11 @@
+// CS0115: `B.MyMissingSuperclassEvent' is marked as an override but no suitable event found to override
+// Line: 10
+
+using System;
+
+class A {
+}
+
+class B : A {
+       public override event EventHandler MyMissingSuperclassEvent;
+}
\ No newline at end of file
index 189f01ace2d2838fa2245f67769fd9d4eb9a835c..aca0420eee2efd1798c719634b81daf26ec1c2db 100644 (file)
@@ -1,5 +1,5 @@
-// cs0115.cs: `X.Bla()': no suitable method found to override
-// Line: 9
+// CS0115: `X.Bla()' is marked as an override but no suitable method found to override
+// Line: 5
 
 class X {
        public override void Bla ()
diff --git a/mcs/errors/cs0179-2.cs b/mcs/errors/cs0179-2.cs
new file mode 100644 (file)
index 0000000..bfa2334
--- /dev/null
@@ -0,0 +1,14 @@
+// CS0179: `Bar.OnFoo' cannot declare a body because it is marked extern
+// Line: 9
+
+using System;
+
+public delegate void FooHandler ();
+
+class Bar {
+       extern event FooHandler OnFoo {
+               add { }
+               remove { }
+       }
+}
+
diff --git a/mcs/errors/cs0179-3.cs b/mcs/errors/cs0179-3.cs
new file mode 100644 (file)
index 0000000..724978e
--- /dev/null
@@ -0,0 +1,10 @@
+// CS0179: `Bar.Foo' cannot declare a body because it is marked extern
+// Line: 5
+
+class Bar {
+       extern int Foo {
+               set { }
+               get { }
+       }
+}
+
index 9f9f93d62d9f1d1c3a7b1f002c40887de454c1f8..57d8e01d261ea72f9dc2559ec9cf789e0f2a03ad 100644 (file)
@@ -1,3 +1,7 @@
+// CS0266: Cannot implicitly convert type `System.IntPtr' to `byte*'. An explicit conversion exists (are you missing a cast?)
+// Line: 23
+// Compiler options: -unsafe
+
 using System;
 
 public class Pixbuf {
diff --git a/mcs/errors/cs0505-2.cs b/mcs/errors/cs0505-2.cs
new file mode 100644 (file)
index 0000000..cf64453
--- /dev/null
@@ -0,0 +1,13 @@
+// CS0505: `DerivedClass.value()': cannot override because `BaseClass.value' is not a method
+// Line: 9
+
+using System;
+
+class BaseClass {
+        protected int value;
+}
+
+class DerivedClass: BaseClass {
+        protected override EventHandler value() {}
+}
+
diff --git a/mcs/errors/cs0505-3.cs b/mcs/errors/cs0505-3.cs
new file mode 100644 (file)
index 0000000..66893f9
--- /dev/null
@@ -0,0 +1,13 @@
+// CS0505: `DerivedClass.value()': cannot override because `BaseClass.value' is not a method
+// Line: 9
+
+using System;
+
+class BaseClass {
+        protected EventHandler value;
+}
+
+class DerivedClass: BaseClass {
+        protected override void value() {}
+}
+
diff --git a/mcs/errors/cs0506-2.cs b/mcs/errors/cs0506-2.cs
new file mode 100644 (file)
index 0000000..da11fbe
--- /dev/null
@@ -0,0 +1,13 @@
+// CS0506: `DerivedClass.Test': cannot override inherited member `BaseClass.Test' because it is not marked virtual, abstract or override
+// Line: 11
+
+using System;
+
+class BaseClass {
+        protected event EventHandler Test;
+}
+
+class DerivedClass: BaseClass {
+        protected override event EventHandler Test;
+}
+
diff --git a/mcs/errors/cs0507-3.cs b/mcs/errors/cs0507-3.cs
new file mode 100644 (file)
index 0000000..a1a72ad
--- /dev/null
@@ -0,0 +1,13 @@
+// CS0507: `DerivedClass.Test': cannot change access modifiers when overriding `protected' inherited member `BaseClass.Test'
+// Line: 11
+
+using System;
+
+class BaseClass {
+        protected virtual event EventHandler Test;
+}
+
+class DerivedClass: BaseClass {
+        public override sealed event EventHandler Test;
+}
+
diff --git a/mcs/errors/cs0533-2.cs b/mcs/errors/cs0533-2.cs
new file mode 100644 (file)
index 0000000..2835bd0
--- /dev/null
@@ -0,0 +1,12 @@
+// CS0533: `B.MyEvent' hides inherited abstract member `A.MyEvent'
+// Line: 11
+
+using System;
+
+abstract class A {
+       public abstract event EventHandler MyEvent;
+}
+
+class B : A {
+       public new event EventHandler MyEvent;
+}
diff --git a/mcs/errors/cs0534-5.cs b/mcs/errors/cs0534-5.cs
new file mode 100644 (file)
index 0000000..66b2a27
--- /dev/null
@@ -0,0 +1,12 @@
+// CS0534: `B' does not implement inherited abstract member `A.MyEvent.add'
+// Line: 11
+
+using System;
+
+abstract class A {
+       public abstract event EventHandler MyEvent;
+}
+
+class B : A {
+       public event EventHandler MyEvent;
+}
index cd22979f4b38bca46b174901430617d88b219a4b..b5f059889f8b7054b17ab4d30bf2d834ded96dc4 100644 (file)
@@ -1,4 +1,4 @@
-// cs0626-2.cs: Method, operator, or accessor `ExternClass.ExternMethod.set' is marked external and has no attributes on it. Consider adding a DllImport attribute to specify the external implementation
+// CS0626: `ExternClass.ExternMethod' is marked as an external but has no DllImport attribute. Consider adding a DllImport attribute to specify the external implementation
 // Line: 6
 // Compiler options: -warnaserror -warn:1
 
index 8d311d40a79f993c5610a8cd22e1f30b63dc78ad..ceb1778aec0a41a8074c9165d648a00ea695c781 100644 (file)
@@ -1,4 +1,4 @@
-// cs0626-3.cs: Method, operator, or accessor `ExternClass.implicit operator ExternClass(byte)' is marked external and has no attributes on it. Consider adding a DllImport attribute to specify the external implementation
+// CS0626: `ExternClass.implicit operator ExternClass(byte)' is marked as an external but has no DllImport attribute. Consider adding a DllImport attribute to specify the external implementation
 // Line: 6
 // Compiler options: -warnaserror -warn:1
 
index ce3d17a7011e01e46467ca2f0b0d7bc660973f37..d18847ccdbc9731546e1e7106a58b269fb33dadb 100644 (file)
@@ -1,4 +1,4 @@
-// cs0626-4.cs: Method, operator, or accessor `ExternClass.ExternMethod()' is marked external and has no attributes on it. Consider adding a DllImport attribute to specify the external implementation
+// CS0626: `ExternClass.ExternMethod()' is marked as an external but has no DllImport attribute. Consider adding a DllImport attribute to specify the external implementation
 // Line: 6
 // Compiler options: -warnaserror -warn:1
 
diff --git a/mcs/errors/cs0626-5.cs b/mcs/errors/cs0626-5.cs
new file mode 100644 (file)
index 0000000..2a7e45b
--- /dev/null
@@ -0,0 +1,13 @@
+// CS0626: `Test.OnFoo' is marked as an external but has no DllImport attribute. Consider adding a DllImport attribute to specify the external implementation
+// Line: 9
+// Compiler options: -warnaserror -warn:1
+
+
+using System;
+
+public delegate void Handler ();
+
+class Test {
+       extern event Handler OnFoo;
+}
+
index a9e34d67a2de2b9001ac202d0179587542bea9f8..e344888d91ba345598562fc53e9eabfa77a3ba82 100644 (file)
@@ -1,4 +1,4 @@
-// cs0626.cs: Method, operator, or accessor `ExternClass.ExternMethod()' is marked external and has no attributes on it. Consider adding a DllImport attribute to specify the external implementation
+// CS0626: `ExternClass.ExternMethod()' is marked as an external but has no DllImport attribute. Consider adding a DllImport attribute to specify the external implementation
 // Line: 6
 // Compiler options: -warnaserror -warn:1
 
diff --git a/mcs/errors/cs0672-4.cs b/mcs/errors/cs0672-4.cs
new file mode 100644 (file)
index 0000000..c9aaebc
--- /dev/null
@@ -0,0 +1,14 @@
+// CS0672: Member `B.MyEvent' overrides obsolete member `A.MyEvent'. Add the Obsolete attribute to `B.MyEvent'
+// Line: 13
+// Compiler options: -warnaserror
+
+using System;
+
+class A {
+       [Obsolete]
+       public virtual event EventHandler MyEvent;
+}
+
+class B : A {
+       public override event EventHandler MyEvent;
+}
diff --git a/mcs/errors/cs1715-2.cs b/mcs/errors/cs1715-2.cs
new file mode 100644 (file)
index 0000000..9937532
--- /dev/null
@@ -0,0 +1,17 @@
+// CS1715: `DerivedClass.Prop': type must be `System.EventHandler' to match overridden member `BaseClass.Prop'
+// Line: 9
+
+using System;
+
+class BaseClass {
+        protected virtual event EventHandler Prop;
+}
+
+delegate void TestD ();
+
+class DerivedClass: BaseClass {
+        protected override event TestD Prop;
+}
+
+
+