Skip to content

Port #61683: Use getNonMissingTypeOfSymbol in compareProperties - #2726

Merged
Jake Bailey (jakebailey) merged 3 commits into
mainfrom
copilot/port-compare-properties-fix
Feb 10, 2026
Merged

Port #61683: Use getNonMissingTypeOfSymbol in compareProperties#2726
Jake Bailey (jakebailey) merged 3 commits into
mainfrom
copilot/port-compare-properties-fix

Conversation

Copilot AI commented Feb 10, 2026

Copy link
Copy Markdown
Contributor
  • Change getTypeOfSymbol to getNonMissingTypeOfSymbol in compareProperties function (checker.go:27072)
  • Build and verify the change compiles
  • Run full test suite and accept all baseline changes
  • exactOptionalPropertyTypesIdentical baseline accepted
  • multipleBaseInterfaesWithIncompatibleProperties2 (exactoptionalpropertytypes=true) baseline accepted — diff file deleted (output now matches TS reference)

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…operties

Don't compare "missing" to undefined in compareProperties under
exactOptionalPropertyTypes. This changes getTypeOfSymbol to
getNonMissingTypeOfSymbol for both source and target properties
in the compareProperties function.

Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com>
Copilot AI changed the title [WIP] Port fix for comparing missing to undefined in compareProperties Port #61683: Use getNonMissingTypeOfSymbol in compareProperties Feb 10, 2026
@jakebailey
Jake Bailey (jakebailey) marked this pull request as ready for review February 10, 2026 21:44
Copilot AI review requested due to automatic review settings February 10, 2026 21:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 ports microsoft/TypeScript#61683 to fix a bug in property comparison under exactOptionalPropertyTypes mode. The issue caused optional properties with and without explicit | undefined to be incorrectly treated as identical in conditional type resolution.

Changes:

  • Updated compareProperties to use getNonMissingTypeOfSymbol instead of getTypeOfSymbol to properly strip the internal "missing" type marker before comparison
  • Added test baseline showing the now-correctly-detected type error for the scenario described in the issue

Reviewed changes

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

File Description
internal/checker/checker.go Changed property type comparison to use getNonMissingTypeOfSymbol for both source and target properties
testdata/baselines/reference/submodule/compiler/exactOptionalPropertyTypesIdentical.errors.txt Added expected error output showing the fix correctly detects type incompatibility
testdata/baselines/reference/submodule/compiler/exactOptionalPropertyTypesIdentical.errors.txt.diff Removed the diff file indicating no previous errors were expected

@jakebailey

Copy link
Copy Markdown
Member

Copilot You still need to run the tests and accept all baseline changes

Accept baseline for multipleBaseInterfaesWithIncompatibleProperties2
with exactoptionalpropertytypes=true, which now correctly reports
TS2320 error matching the TypeScript reference.

Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com>

Copilot AI commented Feb 10, 2026

Copy link
Copy Markdown
Contributor Author

Copilot You still need to run the tests and accept all baseline changes

Ran the full test suite and accepted all baseline changes in 0683d859. There was one additional test affected: multipleBaseInterfaesWithIncompatibleProperties2(exactoptionalpropertytypes=true) — its .diff file was deleted because our output now correctly matches the TypeScript reference baseline. All tests pass.

@jakebailey
Jake Bailey (jakebailey) added this pull request to the merge queue Feb 10, 2026
Merged via the queue into main with commit bb53aa4 Feb 10, 2026
20 checks passed
@jakebailey
Jake Bailey (jakebailey) deleted the copilot/port-compare-properties-fix branch February 10, 2026 22:44
Copilot AI added a commit that referenced this pull request Feb 25, 2026
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com>
Jake Bailey (jakebailey) added a commit to jakebailey/TypeScript that referenced this pull request Aug 13, 2026
…compareProperties (microsoft/typescript-go#2726)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com>
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.

4 participants