| 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 c16dcef20887799fb7cade598beafad4a5b43b29..136e24098b2611e4a70e9bc9e6141c6cfcaddba8 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);
|
|
|