2002-11-14 Martin Baulig <martin@ximian.com>
[mono.git] / mcs / mcs / assign.cs
index 5956d38ccf2bc1dc92c79eac679f9f372a8f9633..225283189fdb81d7a309c2eb66385a5a80198375 100755 (executable)
@@ -235,14 +235,11 @@ namespace Mono.CSharp {
                        }
 
                        if (target is EventExpr) {
-
-                               Binary tmp;
                                EventInfo ei = ((EventExpr) target).EventInfo;
 
-
                                Expression ml = MemberLookup (
                                        ec, ec.ContainerType, ei.Name,
-                                       MemberTypes.Event, AllBindingFlags, loc);
+                                       MemberTypes.Event, AllBindingFlags | BindingFlags.DeclaredOnly, loc);
 
                                if (ml == null) {
                                        //
@@ -260,7 +257,7 @@ namespace Mono.CSharp {
                                                error70 (ei, loc);
                                                return null;
                                        } else {
-                                               tmp = ((Binary) source);
+                                               Binary tmp = ((Binary) source);
                                                if (tmp.Oper != Binary.Operator.Addition &&
                                                    tmp.Oper != Binary.Operator.Subtraction) {
                                                        error70 (ei, loc);