| Index: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/TypePromotionManager.java
|
| diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/TypePromotionManager.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/TypePromotionManager.java
|
| index 620da0cd472bdc139969f8e9cabbb1d2f00716c6..cd0e0f7bb856cc181daeb7535f2613ec72520e32 100644
|
| --- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/TypePromotionManager.java
|
| +++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/TypePromotionManager.java
|
| @@ -15,6 +15,7 @@ package com.google.dart.engine.internal.resolver;
|
|
|
| import com.google.dart.engine.element.Element;
|
| import com.google.dart.engine.element.PropertyAccessorElement;
|
| +import com.google.dart.engine.element.VariableElement;
|
| import com.google.dart.engine.type.Type;
|
|
|
| import java.util.Collection;
|
| @@ -124,6 +125,19 @@ public class TypePromotionManager {
|
| }
|
|
|
| /**
|
| + * Returns static type of the given variable - declared or promoted.
|
| + *
|
| + * @return the static type of the given variable - declared or promoted
|
| + */
|
| + public Type getStaticType(VariableElement variable) {
|
| + Type staticType = getType(variable);
|
| + if (staticType == null) {
|
| + staticType = variable.getType();
|
| + }
|
| + return staticType;
|
| + }
|
| +
|
| + /**
|
| * Return the promoted type of the given element, or {@code null} if the type of the element has
|
| * not been promoted.
|
| *
|
|
|