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 d5045a239c38d400d8633a13bdd84805c49fecd1..967861c74deb466dc6d269c6afb19fbac28edcaf 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 |
@@ -13,6 +13,7 @@ |
*/ |
package com.google.dart.engine.internal.resolver; |
+import com.google.dart.engine.AnalysisEngine; |
import com.google.dart.engine.ast.Annotation; |
import com.google.dart.engine.ast.ArgumentList; |
import com.google.dart.engine.ast.AsExpression; |
@@ -729,13 +730,15 @@ public class ResolverVisitor extends ScopedVisitor { |
overrideManager.applyOverrides(elseOverrides); |
} |
} else if (!thenIsAbrupt && !elseIsAbrupt) { |
- // It would be more precise to ignore the existing override for any variable that |
- // is overridden in both branches. |
- if (thenOverrides != null) { |
- overrideManager.mergeOverrides(thenOverrides); |
- } |
- if (elseOverrides != null) { |
- overrideManager.mergeOverrides(elseOverrides); |
+ if (AnalysisEngine.getInstance().getEnableUnionTypes()) { |
+ // It would be more precise to ignore the existing override for any variable that |
+ // is overridden in both branches. |
+ if (thenOverrides != null) { |
+ overrideManager.mergeOverrides(thenOverrides); |
+ } |
+ if (elseOverrides != null) { |
+ overrideManager.mergeOverrides(elseOverrides); |
+ } |
} |
} |
return null; |