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

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

Issue 10837237: Issue 4383. Calling field without setter should generate problem (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Use same text for error as for warning Created 8 years, 4 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 a5a5fa93c38501fa21d3b213873e7281c1a57780..d3b07f439cf46c6b63a4408599f7034a2a2fb8ef 100644
--- a/compiler/java/com/google/dart/compiler/resolver/Resolver.java
+++ b/compiler/java/com/google/dart/compiler/resolver/Resolver.java
@@ -1393,6 +1393,14 @@ public class Resolver {
} else {
checkInvocationTarget(x, currentMethod, element);
}
+ if (Elements.isAbstractFieldWithoutGetter(element)) {
+ String name = element.getName();
+ if (isStaticContextOrInitializer()) {
+ onError(x.getTarget(), ResolverErrorCode.USE_ASSIGNMENT_ON_SETTER, name);
+ } else {
+ onError(x.getTarget(), TypeErrorCode.USE_ASSIGNMENT_ON_SETTER, name);
+ }
+ }
recordElement(x, element);
recordElement(x.getTarget(), element);
visit(x.getArguments());

Powered by Google App Engine
This is Rietveld 408576698