| Index: sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
|
| diff --git a/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart b/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
|
| index 2d9c62a1dd6c88c157346b9aa3617fa855d71c14..09df7c19cc9550e28a097d8b4d37b6a94b5ba67e 100644
|
| --- a/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
|
| +++ b/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
|
| @@ -606,7 +606,9 @@ class SsaConstantFolder extends HBaseVisitor implements OptimizationPhase {
|
| HInstruction visitTypeConversion(HTypeConversion node) {
|
| HInstruction value = node.inputs[0];
|
| DartType type = node.typeExpression;
|
| - if (type != null && !type.isRaw) return node;
|
| + if (type != null && (!type.isRaw || type.kind == TypeKind.TYPE_VARIABLE)) {
|
| + return node;
|
| + }
|
| HType convertedType = node.instructionType;
|
| if (convertedType.isUnknown()) return node;
|
| HType combinedType = value.instructionType.intersection(
|
| @@ -723,9 +725,15 @@ class SsaConstantFolder extends HBaseVisitor implements OptimizationPhase {
|
| // interceptor.
|
| HInstruction value = node.inputs.last;
|
| if (compiler.enableTypeAssertions) {
|
| + DartType type = field.computeType(compiler);
|
| + if (!type.isRaw || type.kind == TypeKind.TYPE_VARIABLE) {
|
| + // We cannot generate the correct type representation here, so don't
|
| + // inline this access.
|
| + return node;
|
| + }
|
| HInstruction other = value.convertType(
|
| compiler,
|
| - field.computeType(compiler),
|
| + type,
|
| HTypeConversion.CHECKED_MODE_CHECK);
|
| if (other != value) {
|
| node.block.addBefore(node, other);
|
|
|