| Index: pkg/front_end/lib/src/fasta/type_inference/type_promotion.dart
|
| diff --git a/pkg/front_end/lib/src/fasta/type_inference/type_promotion.dart b/pkg/front_end/lib/src/fasta/type_inference/type_promotion.dart
|
| index be3152daeccbd69aac8ea8efa5b357c48e85fec3..80229e9c0f6d1324c67e729cacf31626cc8016d6 100644
|
| --- a/pkg/front_end/lib/src/fasta/type_inference/type_promotion.dart
|
| +++ b/pkg/front_end/lib/src/fasta/type_inference/type_promotion.dart
|
| @@ -198,6 +198,7 @@ abstract class TypePromoterImpl<E, V> extends TypePromoter<E, V> {
|
| void handleIsCheck(E isExpression, bool isInverted, V variable, DartType type,
|
| int functionNestingLevel) {
|
| debugEvent('handleIsCheck');
|
| + if (!isPromotionCandidate(variable)) return;
|
| var isCheck = new _IsCheck<V>(
|
| ++_lastFactSequenceNumber,
|
| variable,
|
| @@ -212,6 +213,14 @@ abstract class TypePromoterImpl<E, V> extends TypePromoter<E, V> {
|
| }
|
| }
|
|
|
| + /// Determines whether the given variable should be considered for promotion
|
| + /// at all.
|
| + ///
|
| + /// This is needed because in kernel, [VariableDeclaration] objects are
|
| + /// sometimes used to represent local functions, which are not subject to
|
| + /// promotion.
|
| + bool isPromotionCandidate(V variable);
|
| +
|
| /// Updates the state to reflect the fact that the given [variable] was
|
| /// mutated.
|
| void mutateVariable(V variable, int functionNestingLevel) {
|
|
|