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

Unified Diff: compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java

Issue 10661056: Issue 3860. Check that setter/getter are both static or not static (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/type/TypeAnalyzer.java
diff --git a/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java b/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
index 4555fa21a0af048b88d824edeafb1ab6d5a1fb89..ba70eaa648c10740148719435415b75b77a89b9d 100644
--- a/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
+++ b/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
@@ -1717,6 +1717,11 @@ public class TypeAnalyzer implements DartCompilationPhase {
typeError(parameterElement, TypeErrorCode.SETTER_TYPE_MUST_BE_ASSIGNABLE,
setterType.getElement().getName(), getterType.getElement().getName());
}
+
+ // getter and setter should have same "static" flag
+ if (modifiers.isStatic() != getterElement.getModifiers().isStatic()) {
+ onError(node.getName(), ResolverErrorCode.FIELD_GETTER_SETTER_SAME_STATIC);
+ }
}
}
}

Powered by Google App Engine
This is Rietveld 408576698