| 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 8c37b3ac201a5800178f8ce0a506e976b0d70912..383b39fb68ce20471bb7b6a76aadfcea68172dd6 100644
|
| --- a/pkg/compiler/lib/src/cps_ir/type_propagation.dart
|
| +++ b/pkg/compiler/lib/src/cps_ir/type_propagation.dart
|
| @@ -321,7 +321,13 @@ class ConstantPropagationLattice {
|
| /// [typedSelector]. If the given selector is not a [TypedSelector], any
|
| /// reachable method matching the selector may be targeted.
|
| AbstractValue getInvokeReturnType(Selector selector, TypeMask mask) {
|
| - return nonConstant(typeSystem.getInvokeReturnType(selector, mask));
|
| + return fromMask(typeSystem.getInvokeReturnType(selector, mask));
|
| + }
|
| +
|
| + AbstractValue fromMask(TypeMask mask) {
|
| + ConstantValue constantValue = typeSystem.getConstantOf(mask);
|
| + if (constantValue != null) return constant(constantValue, mask);
|
| + return nonConstant(mask);
|
| }
|
| }
|
|
|
| @@ -2066,7 +2072,7 @@ class TypePropagationVisitor implements Visitor {
|
| TypeMask type = param.hint is ParameterElement
|
| ? typeSystem.getParameterType(param.hint)
|
| : typeSystem.dynamicType;
|
| - setValue(param, nonConstant(type));
|
| + setValue(param, lattice.fromMask(type));
|
| }
|
| push(node.body);
|
| }
|
| @@ -2113,7 +2119,7 @@ class TypePropagationVisitor implements Visitor {
|
| }
|
|
|
| TypeMask returnType = typeSystem.getReturnType(node.target);
|
| - setResult(node, nonConstant(returnType));
|
| + setResult(node, lattice.fromMask(returnType));
|
| }
|
|
|
| void visitInvokeContinuation(InvokeContinuation node) {
|
|
|