Skip to content

Commit c757fda

Browse files
stereotype441Commit Queue
authored andcommitted
[front end] Eliminate unnecessary code path.
Now that null-aware guard variables are handled specially by flow analysis (see https://dart-review.googlesource.com/c/sdk/+/427341), all variables passed to `OperationsCfe.variableType` are instances of `VariableDeclarationImpl`. Change-Id: I1c7d990cc7f0539767c476e9a884aeff90af6a23 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/427800 Reviewed-by: Chloe Stefantsova <[email protected]> Commit-Queue: Paul Berry <[email protected]>
1 parent e252d45 commit c757fda

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

pkg/front_end/lib/src/type_inference/type_inference_engine.dart

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -666,16 +666,11 @@ class OperationsCfe
666666
}
667667

668668
@override
669-
SharedTypeView variableType(VariableDeclaration variable) {
670-
if (variable is VariableDeclarationImpl) {
671-
// When late variables get lowered, their type is changed, but the
672-
// original type is stored in `VariableDeclarationImpl.lateType`, so we
673-
// use that if it exists.
674-
return new SharedTypeView(variable.lateType ?? variable.type);
675-
}
676-
// TODO(paulberry): see if this code path can be eliminated.
677-
// Coverage-ignore(suite): Not run.
678-
return new SharedTypeView(variable.type);
669+
SharedTypeView variableType(covariant VariableDeclarationImpl variable) {
670+
// When late variables get lowered, their type is changed, but the
671+
// original type is stored in `VariableDeclarationImpl.lateType`, so we
672+
// use that if it exists.
673+
return new SharedTypeView(variable.lateType ?? variable.type);
679674
}
680675

681676
@override

0 commit comments

Comments
 (0)