Skip to content

Conversation

@weswigham
Copy link
Member

Fixes #41386 by broadening our simplification of a spread of undefined | A to be the same as Partial<A> to also recognize things like undefined | false | A as the same as Partial<A>. Doing this made it obvious that we also needed to fix #41418, thanks to the introduction of more of those spread-synthetic optional properties. So this also contains the fix for that, making this PR require #41921 get merged for it to be reasonable (I have left one failing test which should pass once #41921 is merged).

@weswigham
Copy link
Member Author

weswigham commented Jan 7, 2021

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 7, 2021

Heya @weswigham, I've started to run the extended test suite on this PR at 35277d9. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 7, 2021

Heya @weswigham, I've started to run the parallelized community code test suite on this PR at 35277d9. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 7, 2021

Heya @weswigham, I've started to run the parallelized Definitely Typed test suite on this PR at 35277d9. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

The user suite test run you requested has finished and failed. I've opened a PR with the baseline diff from master.

@weswigham
Copy link
Member Author

Tests all look good, so I'll merge~

@weswigham weswigham merged commit 11606e4 into microsoft:master Jan 7, 2021
@weswigham weswigham deleted the broadening-optional-spread-heuristic branch January 7, 2021 20:05
Zzzen pushed a commit to Zzzen/TypeScript that referenced this pull request Jan 16, 2021
… of 2 (microsoft#42233)

* Do for unions of many empty-object-spreadables what we did for unions of 2

* Accept baseline
@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.

Optional properties coming from conditional spread lose "| undefined" Conditional spread results in weird union type, with duplicates

3 participants