Skip to content

Port getSyntacticNullishnessSemantics changes #1040

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

Andarist
Copy link
Contributor

@Andarist Andarist commented Jun 4, 2025

@Copilot Copilot AI review requested due to automatic review settings June 4, 2025 11:44
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

Ports updates from TypeScript PRs to align nullish-coalescing predicate semantics in the Go checker and its test baselines.

  • Removes obsolete nullishness errors from the predicateSemantics baselines.
  • Adds TaggedTemplateExpression and MetaProperty to always-truthy cases.
  • Introduces handling for the comma operator by recursing into its right operand.

Reviewed Changes

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

File Description
testdata/baselines/reference/.../predicateSemantics.errors.txt.diff Removed extra ?? unreachable-operand error entries.
testdata/baselines/reference/.../predicateSemantics.errors.txt Updated expected error count and pruned removed entries.
internal/checker/checker.go Added TaggedTemplateExpression, MetaProperty, and a comma-operator case.
Comments suppressed due to low confidence (1)

internal/checker/checker.go:12287

  • Matching on ast.KindCommaToken will never occur because node.Kind represents expression node kinds (e.g., ast.KindBinaryExpression), not operator tokens. Move comma handling into the ast.KindBinaryExpression case by checking node.AsBinaryExpression().OperatorToken.Kind == ast.KindCommaToken.
case ast.KindCommaToken:

@jakebailey jakebailey added this pull request to the merge queue Jun 4, 2025
Merged via the queue into microsoft:main with commit af200c6 Jun 4, 2025
23 checks passed
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.

2 participants