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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | lib/compiler/implementation/warnings.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/resolver.dart
diff --git a/lib/compiler/implementation/resolver.dart b/lib/compiler/implementation/resolver.dart
index 7f2a06750e7d4ae7d34a0ab7fb1a649204eaa7cc..c0a7b149a63a8e5dd74aa27db503620430d445b8 100644
--- a/lib/compiler/implementation/resolver.dart
+++ b/lib/compiler/implementation/resolver.dart
@@ -315,6 +315,9 @@ class ResolverTask extends CompilerTask {
TreeElements resolveField(Element element) {
ahe 2012/10/09 10:20:09 Element -> VariableElement.
jwren 2012/10/09 10:31:15 Done.
Node tree = element.parseNode(compiler);
+ if(element.modifiers.isStatic() && element.getEnclosingClassOrCompilationUnit().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(
+ error(tree, MessageKind.LIBRARY_VARIABLE_AS_STATIC, [element.name]);
+ }
ResolverVisitor visitor = new ResolverVisitor(compiler, element);
initializerDo(tree, visitor.visit);
return visitor.mapping;
« 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