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

Unified Diff: pkg/compiler/lib/src/cps_ir/type_propagation.dart

Issue 1144113003: Fix type propagation for is-tests. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/cps_ir/type_propagation.dart
diff --git a/pkg/compiler/lib/src/cps_ir/type_propagation.dart b/pkg/compiler/lib/src/cps_ir/type_propagation.dart
index 28795ca3e39e49cc0c0370cf5a29379b14f7fa43..2a4307e2e7d01a333240b8505a433a61ccee1fdf 100644
--- a/pkg/compiler/lib/src/cps_ir/type_propagation.dart
+++ b/pkg/compiler/lib/src/cps_ir/type_propagation.dart
@@ -712,14 +712,11 @@ class _TypePropagationVisitor<T> implements Visitor {
_AbstractValue<T> cell = getValue(node.receiver.definition);
if (cell.isNothing) {
return; // And come back later.
- } else if (cell.isNonConst) {
- setValues(nonConstant(cell.type));
- } else if (node.type.kind == types.TypeKind.INTERFACE) {
+ } else if (cell.isConstant && node.type.kind == types.TypeKind.INTERFACE) {
// Receiver is a constant, perform is-checks at compile-time.
types.InterfaceType checkedType = node.type;
ConstantValue constant = cell.constant;
- // TODO(karlklose): remove call to computeType.
types.DartType constantType = constant.getType(_dartTypes.coreTypes);
T type = typeSystem.boolType;
@@ -738,6 +735,8 @@ class _TypePropagationVisitor<T> implements Visitor {
type);
}
setValues(result);
+ } else {
+ setValues(nonConstant(typeSystem.boolType));
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698