Skip to content

Commit 4a9c2c0

Browse files
stereotype441Commit Queue
authored andcommitted
Fix nonspecific type annotation in _getNonPromotionReasons.
Without this change, the local variable `nonPromotionHistory` winds up getting type `NonPromotionHistory<dynamic>?`, and then the assignment `Type nonPromotedType = nonPromotionHistory.type;` winds up performing an implicit dynamic downcast. Change-Id: I4ece2433ac90623b22aa14cff3e1bfe16c9b491c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/389260 Reviewed-by: Kallen Tu <[email protected]> Commit-Queue: Paul Berry <[email protected]>
1 parent 7088dc4 commit 4a9c2c0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5821,7 +5821,7 @@ class _FlowAnalysisImpl<Node extends Object, Statement extends Node,
58215821
Map<Type, NonPromotionReason> result = <Type, NonPromotionReason>{};
58225822
Type currentType = currentPromotionInfo.promotedTypes?.last ??
58235823
operations.variableType(variable);
5824-
NonPromotionHistory? nonPromotionHistory =
5824+
NonPromotionHistory<Type>? nonPromotionHistory =
58255825
currentPromotionInfo.nonPromotionHistory;
58265826
while (nonPromotionHistory != null) {
58275827
Type nonPromotedType = nonPromotionHistory.type;

0 commit comments

Comments
 (0)