@@ -1744,7 +1744,7 @@ mixin TypeAnalyzer<
1744
1744
handleNoGuard (node, i);
1745
1745
// Stack: (Expression, i * ExpressionCase, Pattern, Expression)
1746
1746
}
1747
- handleCaseHead (node, caseIndex: i, subIndex: 0 );
1747
+ handleCaseHead (node, memberInfo.head, caseIndex: i, subIndex: 0 );
1748
1748
} else {
1749
1749
handleDefault (node, caseIndex: i, subIndex: 0 );
1750
1750
}
@@ -1843,7 +1843,9 @@ mixin TypeAnalyzer<
1843
1843
} else {
1844
1844
handleNoGuard (node, caseIndex);
1845
1845
}
1846
- handleCaseHead (node, caseIndex: caseIndex, subIndex: headIndex);
1846
+ head = handleCaseHead (node, head,
1847
+ caseIndex: caseIndex, subIndex: headIndex);
1848
+ guard = head.guard;
1847
1849
} else {
1848
1850
hasDefault = true ;
1849
1851
handleDefault (node, caseIndex: caseIndex, subIndex: headIndex);
@@ -2136,11 +2138,15 @@ mixin TypeAnalyzer<
2136
2138
/// Called after visiting a single `case` clause, consisting of a pattern and
2137
2139
/// an optional guard.
2138
2140
///
2139
- /// [node] is the enclosing switch statement or switch expression and
2141
+ /// [node] is the enclosing switch statement or switch expression,
2142
+ /// [head] is the head to be handled, and
2140
2143
/// [caseIndex] is the index of the `case` clause.
2141
2144
///
2145
+ /// Returns the updated case head.
2146
+ ///
2142
2147
/// Stack effect: pops (Pattern, Expression) and pushes (CaseHead).
2143
- void handleCaseHead (Node node,
2148
+ CaseHeadOrDefaultInfo <Node , Expression , Variable > handleCaseHead (
2149
+ Node node, CaseHeadOrDefaultInfo <Node , Expression , Variable > head,
2144
2150
{required int caseIndex, required int subIndex});
2145
2151
2146
2152
/// Called after visiting a `default` clause.
0 commit comments