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

Side by Side Diff: lib/compiler/implementation/resolver.dart

Issue 11087025: Fix to dartbug.com/5170, explictly static library variables now get an appropriate error message. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase with master Created 8 years, 2 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 | lib/compiler/implementation/tree/nodes.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 abstract class TreeElements { 5 abstract class TreeElements {
6 Element operator[](Node node); 6 Element operator[](Node node);
7 Selector getSelector(Send send); 7 Selector getSelector(Send send);
8 DartType getType(TypeAnnotation annotation); 8 DartType getType(TypeAnnotation annotation);
9 bool isParameterChecked(Element element); 9 bool isParameterChecked(Element element);
10 } 10 }
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 306
307 if (constructor.defaultImplementation === null) { 307 if (constructor.defaultImplementation === null) {
308 // We failed to find a constructor named either 308 // We failed to find a constructor named either
309 // "MyInterface.name" or "MyClass.name". 309 // "MyInterface.name" or "MyClass.name".
310 error(node, 310 error(node,
311 MessageKind.CANNOT_FIND_CONSTRUCTOR2, 311 MessageKind.CANNOT_FIND_CONSTRUCTOR2,
312 [name, defaultClass.name]); 312 [name, defaultClass.name]);
313 } 313 }
314 } 314 }
315 315
316 TreeElements resolveField(Element element) { 316 TreeElements resolveField(VariableElement element) {
317 Node tree = element.parseNode(compiler); 317 Node tree = element.parseNode(compiler);
318 if(element.modifiers.isStatic() && element.variables.isTopLevel()) {
319 error(element.modifiers.getStatic(), MessageKind.TOP_LEVEL_VARIABLE_DECLAR ED_STATIC);
320 }
318 ResolverVisitor visitor = new ResolverVisitor(compiler, element); 321 ResolverVisitor visitor = new ResolverVisitor(compiler, element);
319 initializerDo(tree, visitor.visit); 322 initializerDo(tree, visitor.visit);
320 return visitor.mapping; 323 return visitor.mapping;
321 } 324 }
322 325
323 TreeElements resolveParameter(Element element) { 326 TreeElements resolveParameter(Element element) {
324 Node tree = element.parseNode(compiler); 327 Node tree = element.parseNode(compiler);
325 ResolverVisitor visitor = 328 ResolverVisitor visitor =
326 new ResolverVisitor(compiler, element.enclosingElement); 329 new ResolverVisitor(compiler, element.enclosingElement);
327 initializerDo(tree, visitor.visit); 330 initializerDo(tree, visitor.visit);
(...skipping 2811 matching lines...) Expand 10 before | Expand all | Expand 10 after
3139 return result; 3142 return result;
3140 } 3143 }
3141 Element lookup(SourceString name) => localLookup(name); 3144 Element lookup(SourceString name) => localLookup(name);
3142 Element lexicalLookup(SourceString name) => localLookup(name); 3145 Element lexicalLookup(SourceString name) => localLookup(name);
3143 3146
3144 Element add(Element newElement) { 3147 Element add(Element newElement) {
3145 throw "Cannot add an element in a patch library scope"; 3148 throw "Cannot add an element in a patch library scope";
3146 } 3149 }
3147 String toString() => 'PatchLibraryScope($origin,$patch)'; 3150 String toString() => 'PatchLibraryScope($origin,$patch)';
3148 } 3151 }
OLDNEW
« no previous file with comments | « no previous file | lib/compiler/implementation/tree/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698