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

Unified Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/ResolverVisitor.java

Issue 592923002: Put union types behind a flag. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Make union-type options available in [AnalysisEngine]. Created 6 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: 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;

Powered by Google App Engine
This is Rietveld 408576698