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

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

Issue 10986026: Issue 5440. Fixes for exceptions during resolving (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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 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);

Powered by Google App Engine
This is Rietveld 408576698