| Index: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/StaticTypeAnalyzer.java
|
| diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/StaticTypeAnalyzer.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/StaticTypeAnalyzer.java
|
| index 6dc2f7b0e94a96548e05c0529fec9c3c985fdf07..9d7697872b2edfb9f1cbd4fff1caec9b5ad306b7 100644
|
| --- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/StaticTypeAnalyzer.java
|
| +++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/StaticTypeAnalyzer.java
|
| @@ -194,6 +194,11 @@ public class StaticTypeAnalyzer extends SimpleASTVisitor<Void> {
|
| private TypeOverrideManager overrideManager;
|
|
|
| /**
|
| + * The object keeping track of which elements have had their types promoted.
|
| + */
|
| + private TypePromotionManager promoteManager;
|
| +
|
| + /**
|
| * A table mapping {@link ExecutableElement}s to their propagated return types.
|
| */
|
| private HashMap<ExecutableElement, Type> propagatedReturnTypes = new HashMap<ExecutableElement, Type>();
|
| @@ -214,6 +219,7 @@ public class StaticTypeAnalyzer extends SimpleASTVisitor<Void> {
|
| typeProvider = resolver.getTypeProvider();
|
| dynamicType = typeProvider.getDynamicType();
|
| overrideManager = resolver.getOverrideManager();
|
| + promoteManager = resolver.getPromoteManager();
|
| }
|
|
|
| /**
|
| @@ -1277,7 +1283,10 @@ public class StaticTypeAnalyzer extends SimpleASTVisitor<Void> {
|
| // type = typeProvider.getTypeType());
|
| // }
|
| } else if (element instanceof VariableElement) {
|
| - staticType = ((VariableElement) element).getType();
|
| + staticType = promoteManager.getType(element);
|
| + if (staticType == null) {
|
| + staticType = ((VariableElement) element).getType();
|
| + }
|
| } else if (element instanceof PrefixElement) {
|
| return null;
|
| } else {
|
|
|