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

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

Issue 10592016: Dart Editor overlooks assignment to final fields scoped by "this" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: # Created 8 years, 6 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 c2dc5ac5801446f873fd7960e82b140a898476a1..f46f5b543331c63b97cd017170d93e2264f9edae 100644
--- a/compiler/java/com/google/dart/compiler/resolver/Resolver.java
+++ b/compiler/java/com/google/dart/compiler/resolver/Resolver.java
@@ -1018,7 +1018,7 @@ public class Resolver {
return recordElement(x, element);
}
-
+
/**
* Possibly recursive check on the resolved identifier.
*/
@@ -1093,7 +1093,6 @@ public class Resolver {
onError(x.getName(), ResolverErrorCode.FIELD_DOES_NOT_HAVE_A_SETTER);
}
}
-
break;
case NONE:
@@ -1161,6 +1160,17 @@ public class Resolver {
}
break;
+ case NONE: {
+ // TODO(zundel): This is a bit awkward. Maybe it would be better to have an
+ // ElementKind of THIS just like we have for SUPER?
+ if (x.getQualifier() instanceof DartThisExpression) {
+ Element foundElement = Elements.findElement(currentHolder, x.getPropertyName());
+ if (foundElement != null && !foundElement.getModifiers().isStatic()) {
+ element = foundElement;
+ }
+ }
+ }
+
default:
break;
}
@@ -1857,7 +1867,7 @@ public class Resolver {
checkConstructor(node, constructorElement);
}
-
+
private void onError(HasSourceInfo target, ErrorCode errorCode, Object... arguments) {
context.onError(target, errorCode, arguments);
}

Powered by Google App Engine
This is Rietveld 408576698