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

Unified Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/ResolverVisitor.java

Issue 300033008: Remember propagated types for PropertyInducingElement(s). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/ResolverVisitor.java
diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/ResolverVisitor.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/ResolverVisitor.java
index 9f5b1c3ad742298f2290d53718abf20252ffd072..bf0165ff1d9bf93b540edd4f8c1fa34553fd33e6 100644
--- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/ResolverVisitor.java
+++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/ResolverVisitor.java
@@ -83,6 +83,7 @@ import com.google.dart.engine.element.ParameterElement;
import com.google.dart.engine.element.PropertyInducingElement;
import com.google.dart.engine.element.VariableElement;
import com.google.dart.engine.error.AnalysisErrorListener;
+import com.google.dart.engine.internal.element.PropertyInducingElementImpl;
import com.google.dart.engine.internal.element.VariableElementImpl;
import com.google.dart.engine.internal.scope.Scope;
import com.google.dart.engine.scanner.TokenType;
@@ -1005,14 +1006,15 @@ public class ResolverVisitor extends ScopedVisitor {
if (potentialType == null || potentialType.isBottom()) {
return;
}
- if (element instanceof PropertyInducingElement) {
- PropertyInducingElement variable = (PropertyInducingElement) element;
- if (!variable.isConst() && !variable.isFinal()) {
- return;
- }
- }
Type currentType = getBestType(element);
if (currentType == null || !currentType.isMoreSpecificThan(potentialType)) {
+ if (element instanceof PropertyInducingElement) {
+ PropertyInducingElement variable = (PropertyInducingElement) element;
+ if (!variable.isConst() && !variable.isFinal()) {
+ return;
+ }
+ ((PropertyInducingElementImpl) variable).setPropagatedType(potentialType);
+ }
overrideManager.setType(element, potentialType);
}
}

Powered by Google App Engine
This is Rietveld 408576698