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

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

Issue 10870058: Use intersection of types as type of conditional (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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 f13f1fa0403643c18c75007ae1dad661cfeda01b..92f65afe2754b71240de1d29ff3aa8599ea02416 100644
--- a/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
+++ b/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
@@ -1469,7 +1469,7 @@ public class TypeAnalyzer implements DartCompilationPhase {
checkCondition(node.getCondition());
Type left = typeOf(node.getThenExpression());
Type right = typeOf(node.getElseExpression());
- return types.leastUpperBound(left, right);
+ return types.intersection(left, right);
}
private Type checkCondition(DartExpression condition) {

Powered by Google App Engine
This is Rietveld 408576698