Skip to content

Fix tuple and array comparisons during identity checking#32089

Merged
weswigham merged 1 commit into
microsoft:masterfrom
weswigham:fix-tuple-identity
Jun 26, 2019
Merged

Fix tuple and array comparisons during identity checking#32089
weswigham merged 1 commit into
microsoft:masterfrom
weswigham:fix-tuple-identity

Conversation

@weswigham
Copy link
Copy Markdown
Member

Fixes #31967

We cache isTypeIdenticalTo assuming it is reflexive. We had a bug where [number, ...number[]] compared with number[] returned true, while number[] compared with [number, ...number[]] returned false (that is to say, the result was based on their assignability relationship and not their identity) - so whichever got run first got cached. With this change we now appropriately return false in both cases.

@weswigham
Copy link
Copy Markdown
Member Author

@typescript-bot run dt
@typescript-bot test this

@typescript-bot
Copy link
Copy Markdown
Collaborator

typescript-bot commented Jun 25, 2019

Heya @weswigham, I've started to run the parallelized Definitely Typed test suite on this PR at 2b5fec4. You can monitor the build here. It should now contribute to this PR's status checks.

@typescript-bot
Copy link
Copy Markdown
Collaborator

typescript-bot commented Jun 25, 2019

Heya @weswigham, I've started to run the extended test suite on this PR at 2b5fec4. You can monitor the build here. It should now contribute to this PR's status checks.

@weswigham weswigham merged commit 34eb5dd into microsoft:master Jun 26, 2019
@weswigham weswigham deleted the fix-tuple-identity branch July 2, 2019 01:32
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug/tsserver]Type is changed though it is the same code

3 participants