| Index: pkg/compiler/lib/src/cps_ir/type_mask_system.dart
|
| diff --git a/pkg/compiler/lib/src/cps_ir/type_mask_system.dart b/pkg/compiler/lib/src/cps_ir/type_mask_system.dart
|
| index 58d7330cc754175d428d52499d86a7e1c60d0ad0..ed2157241846a385c363cb7c161c306732ced791 100644
|
| --- a/pkg/compiler/lib/src/cps_ir/type_mask_system.dart
|
| +++ b/pkg/compiler/lib/src/cps_ir/type_mask_system.dart
|
| @@ -16,6 +16,7 @@ import '../types/constants.dart' show computeTypeMask;
|
| import '../universe/selector.dart' show Selector;
|
| import '../universe/call_structure.dart' show CallStructure;
|
| import '../world.dart' show World;
|
| +import '../closure.dart' show ClosureFieldElement, BoxLocal, TypeVariableLocal;
|
|
|
| enum AbstractBool {
|
| True, False, Maybe, Nothing
|
| @@ -181,6 +182,14 @@ class TypeMaskSystem {
|
| }
|
|
|
| TypeMask getFieldType(FieldElement field) {
|
| + if (field is ClosureFieldElement) {
|
| + // The type inference does not report types for all closure fields.
|
| + // Box fields are never null.
|
| + if (field.local is BoxLocal) return nonNullType;
|
| + // Closure fields for type variables contain the internal representation
|
| + // of the type (which can be null), not the Type object.
|
| + if (field.local is TypeVariableLocal) return dynamicType;
|
| + }
|
| return inferrer.getGuaranteedTypeOfElement(field);
|
| }
|
|
|
|
|