// The order is important: this setups the CaptureContext tree hierarchy.
//
if (container == null) {
- Report.Error (1706, l, "Anonymous methods are not allowed in attribute declaration");
return;
}
container.SetHaveAnonymousMethods (l, this);
public override Expression DoResolve (EmitContext ec)
{
+ if (!ec.IsAnonymousMethodAllowed) {
+ Report.Error (1706, loc, "Anonymous methods are not allowed in the attribute declaration");
+ return null;
+ }
+
if (Parameters != null && !Parameters.Resolve (ec)) {
return null;
}