Skip to content

Commit 6c9ec85

Browse files
committed
Apply previous comma fix to right side of comma expression
1 parent 7d6f983 commit 6c9ec85

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/compiler/binder.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1574,6 +1574,11 @@ namespace ts {
15741574
function onExit(node: BinaryExpression, state: WorkArea) {
15751575
if (!state.skip) {
15761576
const operator = node.operatorToken.kind;
1577+
1578+
if (operator === SyntaxKind.CommaToken) {
1579+
maybeBindExpressionFlowIfCall(node.right);
1580+
}
1581+
15771582
if (isAssignmentOperator(operator) && !isAssignmentTarget(node)) {
15781583
bindAssignmentTargetFlow(node.left);
15791584
if (operator === SyntaxKind.EqualsToken && node.left.kind === SyntaxKind.ElementAccessExpression) {

tests/baselines/reference/controlFlowCommaExpressionAssertionMultiple.types

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ function func(foo: any, bar: any) {
2121
>foo : number
2222

2323
bar;
24-
>bar : any
24+
>bar : string
2525
}
2626

0 commit comments

Comments
 (0)