Skip to content

Conversation

ahejlsberg
Copy link
Member

Fixes #1766.

@Copilot Copilot AI review requested due to automatic review settings September 30, 2025 00:11
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a bug in the binding of binary expressions, specifically for comma expressions. The fix corrects how control flow is handled during the binding process by ensuring the proper operands are passed to flow binding functions.

Key changes:

  • Corrected function arguments in comma expression binding to pass operands instead of the parent node
  • Fixed type inference behavior for variables after comma expressions with type assertions

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
internal/binder/binder.go Fixed arguments to maybeBindExpressionFlowIfCall to pass expr.Left and expr.Right instead of node
testdata/baselines/reference/submodule/compiler/controlFlowCommaExpressionAssertionMultiple.types Updated baseline showing corrected type inference after comma expressions
testdata/baselines/reference/submodule/compiler/controlFlowCommaExpressionAssertionMultiple.types.diff Removed diff file indicating the port now matches TypeScript behavior

@ahejlsberg ahejlsberg added this pull request to the merge queue Sep 30, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Sep 30, 2025
@jakebailey jakebailey added this pull request to the merge queue Sep 30, 2025
Merged via the queue into main with commit 0442f87 Sep 30, 2025
22 checks passed
@jakebailey jakebailey deleted the fix-1766 branch September 30, 2025 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Type narrowing in comma operator inconsistent with 5.8

2 participants