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

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: Fixed merge mistake. 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/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 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(Element element) {
ahe 2012/10/09 10:20:09 Element -> VariableElement.
jwren 2012/10/09 10:31:15 Done.
317 Node tree = element.parseNode(compiler); 317 Node tree = element.parseNode(compiler);
318 if(element.modifiers.isStatic() && element.getEnclosingClassOrCompilationUni t().isCompilationUnit()) {
ahe 2012/10/09 10:20:09 Long line.
ahe 2012/10/09 10:20:09 I think it should element.variables.isTopLevel(),
jwren 2012/10/09 10:31:15 Done- changing it to element.variables.isTopLevel(
319 error(tree, MessageKind.LIBRARY_VARIABLE_AS_STATIC, [element.name]);
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 2804 matching lines...) Expand 10 before | Expand all | Expand 10 after
3132 return result; 3135 return result;
3133 } 3136 }
3134 Element lookup(SourceString name) => localLookup(name); 3137 Element lookup(SourceString name) => localLookup(name);
3135 Element lexicalLookup(SourceString name) => localLookup(name); 3138 Element lexicalLookup(SourceString name) => localLookup(name);
3136 3139
3137 Element add(Element newElement) { 3140 Element add(Element newElement) {
3138 throw "Cannot add an element in a patch library scope"; 3141 throw "Cannot add an element in a patch library scope";
3139 } 3142 }
3140 String toString() => 'PatchLibraryScope($origin,$patch)'; 3143 String toString() => 'PatchLibraryScope($origin,$patch)';
3141 } 3144 }
OLDNEW
« no previous file with comments | « no previous file | lib/compiler/implementation/warnings.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698