| Index: sdk/lib/_internal/compiler/implementation/resolution/members.dart
|
| diff --git a/sdk/lib/_internal/compiler/implementation/resolution/members.dart b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
|
| index ed986ed2d190767c86265e5430907b22e3824358..5985ca83ee78b8e2008806658c3472aaacd6f20b 100644
|
| --- a/sdk/lib/_internal/compiler/implementation/resolution/members.dart
|
| +++ b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
|
| @@ -1821,8 +1821,13 @@ class ResolverVisitor extends CommonResolverVisitor<Element> {
|
| }
|
|
|
| void setupFunction(FunctionExpression node, FunctionElement function) {
|
| - scope = new MethodScope(scope, function);
|
| + Element enclosingElement = function.enclosingElement;
|
| + if (node.modifiers.isStatic() &&
|
| + enclosingElement.kind != ElementKind.CLASS) {
|
| + compiler.reportErrorCode(node, MessageKind.ILLEGAL_STATIC);
|
| + }
|
|
|
| + scope = new MethodScope(scope, function);
|
| // Put the parameters in scope.
|
| FunctionSignature functionParameters =
|
| function.computeSignature(compiler);
|
|
|