Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: sdk/lib/_internal/compiler/implementation/resolution/members.dart

Issue 12620002: Emit compile time error on static non-members. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Reword warning and move it before the crash messages. Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/warnings.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of resolution; 5 part of resolution;
6 6
7 abstract class TreeElements { 7 abstract class TreeElements {
8 Element operator[](Node node); 8 Element operator[](Node node);
9 Selector getSelector(Send send); 9 Selector getSelector(Send send);
10 Selector getGetterSelectorInComplexSendSet(SendSet node); 10 Selector getGetterSelectorInComplexSendSet(SendSet node);
(...skipping 1803 matching lines...) Expand 10 before | Expand all | Expand 10 after
1814 Initializers.isConstructorRedirect(initializers.head)) { 1814 Initializers.isConstructorRedirect(initializers.head)) {
1815 Selector selector = 1815 Selector selector =
1816 getRedirectingThisOrSuperConstructorSelector(initializers.head); 1816 getRedirectingThisOrSuperConstructorSelector(initializers.head);
1817 final ClassElement classElement = constructor.getEnclosingClass(); 1817 final ClassElement classElement = constructor.getEnclosingClass();
1818 return classElement.lookupConstructor(selector); 1818 return classElement.lookupConstructor(selector);
1819 } 1819 }
1820 return null; 1820 return null;
1821 } 1821 }
1822 1822
1823 void setupFunction(FunctionExpression node, FunctionElement function) { 1823 void setupFunction(FunctionExpression node, FunctionElement function) {
1824 Element enclosingElement = function.enclosingElement;
1825 if (node.modifiers.isStatic() &&
1826 enclosingElement.kind != ElementKind.CLASS) {
1827 compiler.reportErrorCode(node, MessageKind.ILLEGAL_STATIC);
1828 }
1829
1824 scope = new MethodScope(scope, function); 1830 scope = new MethodScope(scope, function);
1825
1826 // Put the parameters in scope. 1831 // Put the parameters in scope.
1827 FunctionSignature functionParameters = 1832 FunctionSignature functionParameters =
1828 function.computeSignature(compiler); 1833 function.computeSignature(compiler);
1829 Link<Node> parameterNodes = (node.parameters == null) 1834 Link<Node> parameterNodes = (node.parameters == null)
1830 ? const Link<Node>() : node.parameters.nodes; 1835 ? const Link<Node>() : node.parameters.nodes;
1831 functionParameters.forEachParameter((Element element) { 1836 functionParameters.forEachParameter((Element element) {
1832 if (element == functionParameters.optionalParameters.head) { 1837 if (element == functionParameters.optionalParameters.head) {
1833 NodeList nodes = parameterNodes.head; 1838 NodeList nodes = parameterNodes.head;
1834 parameterNodes = nodes.nodes; 1839 parameterNodes = nodes.nodes;
1835 } 1840 }
(...skipping 1984 matching lines...) Expand 10 before | Expand all | Expand 10 after
3820 return e; 3825 return e;
3821 } 3826 }
3822 3827
3823 /// Assumed to be called by [resolveRedirectingFactory]. 3828 /// Assumed to be called by [resolveRedirectingFactory].
3824 Element visitReturn(Return node) { 3829 Element visitReturn(Return node) {
3825 Node expression = node.expression; 3830 Node expression = node.expression;
3826 return finishConstructorReference(visit(expression), 3831 return finishConstructorReference(visit(expression),
3827 expression, expression); 3832 expression, expression);
3828 } 3833 }
3829 } 3834 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/warnings.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698