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

Unified Diff: compiler/java/com/google/dart/compiler/resolver/Resolver.java

Issue 10914215: Issue 5049. Consistently resolve instance/static/top-level property access (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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
Index: compiler/java/com/google/dart/compiler/resolver/Resolver.java
diff --git a/compiler/java/com/google/dart/compiler/resolver/Resolver.java b/compiler/java/com/google/dart/compiler/resolver/Resolver.java
index dfea77d70e7c052920ad61b348d835412868b4c1..f5f255e8c3c594b00dc8e5e6c93ef213dfaa0d37 100644
--- a/compiler/java/com/google/dart/compiler/resolver/Resolver.java
+++ b/compiler/java/com/google/dart/compiler/resolver/Resolver.java
@@ -1274,14 +1274,6 @@ public class Resolver {
onError(x.getName(), ResolverErrorCode.NOT_A_STATIC_FIELD,
x.getPropertyName());
}
- if (Elements.inGetterContext(x)) {
- if (field.getSetter() != null) {
- element = field.getGetter();
- if (element == null) {
- onError(x.getName(), ResolverErrorCode.FIELD_DOES_NOT_HAVE_A_GETTER);
- }
- }
- }
if (Elements.inSetterContext(x)) {
if (field.getGetter() != null) {
element = field.getSetter();
@@ -1290,6 +1282,14 @@ public class Resolver {
}
}
}
+ if (Elements.inGetterContext(x)) {
+ if (field.getSetter() != null) {
+ element = field.getGetter();
+ if (element == null) {
+ onError(x.getName(), ResolverErrorCode.FIELD_DOES_NOT_HAVE_A_GETTER);
+ }
+ }
+ }
break;
case NONE:
@@ -1959,10 +1959,13 @@ public class Resolver {
}
break;
case METHOD:
- if (!lhs.getModifiers().isSetter()) {
+ if (!lhs.getModifiers().isSetter() && !lhs.getModifiers().isGetter()) {
topLevelContext.onError(node.getArg1(), ResolverErrorCode.CANNOT_ASSIGN_TO_METHOD,
lhs.getName());
}
+ if (lhs.getModifiers().isSetter()) {
+ node.setElement(lhs);
+ }
break;
}
}

Powered by Google App Engine
This is Rietveld 408576698