[runtime] Fail gracefully when method has conflicting attributes
[mono.git] / mcs / class / Microsoft.CSharp / Microsoft.CSharp.RuntimeBinder / CSharpIsEventBinder.cs
index 58ab9425e772be186f1c1e8d3f8ed2cfbf6dec86..e485e40ba146458103eb08f81b26595b616cbdd3 100644 (file)
@@ -52,10 +52,11 @@ namespace Microsoft.CSharp.RuntimeBinder
                        var queried_type = ctx.ImportType (target.LimitType);
                        var rc = new Compiler.ResolveContext (new RuntimeBinderContext (ctx, context_type), 0);
 
-                       var expr = Compiler.Expression.MemberLookup (rc, context_type, queried_type, name, 0, false, Compiler.Location.Null);
+                       var expr = Compiler.Expression.MemberLookup (rc, false, queried_type,
+                               name, 0, Compiler.Expression.MemberLookupRestrictions.ExactArity, Compiler.Location.Null);
 
                        var binder = new CSharpBinder (
-                               this, new Compiler.BoolConstant (expr is Compiler.EventExpr, Compiler.Location.Null), null);
+                               this, new Compiler.BoolConstant (ctx.CompilerContext.BuiltinTypes, expr is Compiler.EventExpr, Compiler.Location.Null), null);
 
                        binder.AddRestrictions (target);
                        return binder.Bind (ctx, callingContext);