Merge pull request #5675 from mono/glib-debug-symbols
[mono.git] / mcs / errors / cs0072.cs
index b297e6daae9ecfdb393b0654ea8cadad98149719..29481812a8c74c8732a1d566747fa4aaed9c5b88 100644 (file)
@@ -1,27 +1,21 @@
-// cs0072.cs: An event can override anything but another event.
+// CS0072: `Child.OnFoo': cannot override because `ErrorCS0072.OnFoo()' is not an event
 // Line: 16
 
 using System;
 
 class ErrorCS0072 {
-       delegate void FooHandler ();
-       protected void Callback () {
-       }
-       protected virtual event FooHandler OnFoo;
+       public delegate void FooHandler ();
+       protected void OnFoo () {}
 }
 
 class Child : ErrorCS0072 {
        // We are trying to override a method with an event.
-       // To get this right comment the next line and uncomment the others below.
-       protected override event FooHandler Callback {
-       //protected override event FooHandler OnFoo {
+       protected override event FooHandler OnFoo {
                add {
-                       Callback += value;
-                       //OnFoo += value;
+                       OnFoo += value;
                }
                remove {
-                       Callback -= value;
-                       //OnFoo -= value;
+                       OnFoo -= value;
                }
        }