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 5699afd96415fea6871e546687f5767b2f4951dc..f19b56681088165f520db62ec89f0b9d78328016 100644 |
--- a/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java |
+++ b/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java |
@@ -660,7 +660,7 @@ public class TypeAnalyzer implements DartCompilationPhase { |
* current "basic block" and set new type. |
*/ |
private void setVariableElementType(Element element, Type rhs) { |
- if (element instanceof VariableElement) { |
+ if (ElementKind.of(element) == ElementKind.VARIABLE) { |
VariableElement variableElement = (VariableElement) element; |
Type newType = Types.makeInferred(rhs); |
blockOldTypes.getFirst().setType(variableElement, newType); |