Skip to content

Skip comparing optional property flag when comparing against discriminant properties #38101

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

weswigham
Copy link
Member

When strictNullChecks is on. When that's the case, {x: string | undefined} and {x?: string | undefined} should now both match {x: string} | {x?: undefined} and {x: string} | {x: undefined}. (Since an optional undefined is the same as an undefined field in everything except what we require be written in declarations).

Fixes #35204

@rbuckton
Copy link
Contributor

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 24, 2020

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 24, 2020

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 24, 2020

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

Copy link
Contributor

@rbuckton rbuckton left a comment

Choose a reason for hiding this comment

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

Looks good, just want to make sure the comparability change doesn't affect anything in rwc.

@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

weswigham commented Apr 25, 2020

DT looks OK, user tests look OK, and RWC is zero diff, This seems good~

@weswigham weswigham merged commit 4a5eeb0 into microsoft:master Apr 25, 2020
@weswigham weswigham deleted the skip-optional-flag-check-for-discriminants branch April 25, 2020 01:33
@weswigham
Copy link
Member Author

@DanielRosenwasser does this need to be ported to release-3.9?

@DanielRosenwasser
Copy link
Member

DanielRosenwasser commented Apr 26, 2020

le sigh

@typescript-bot cherry-pick this to release-3.9 and LKG

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 26, 2020

Heya @DanielRosenwasser, I've started to run the task to cherry-pick this into release-3.9 on this PR at f0aeef1. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

Hey @DanielRosenwasser, I've opened #38199 for you.

typescript-bot pushed a commit to typescript-bot/TypeScript that referenced this pull request Apr 26, 2020
Component commits:
f0aeef1 Skip comparing optional property flag when comparing against discriminant properties
DanielRosenwasser pushed a commit that referenced this pull request Apr 26, 2020
…e-3.9 (#38199)

* Cherry-pick PR #38101 into release-3.9

Component commits:
f0aeef1 Skip comparing optional property flag when comparing against discriminant properties

* Update LKG

Co-authored-by: Wesley Wigham <[email protected]>
Co-authored-by: typescript-bot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3.7.2+ Union Type Merged to Single Type in Wrapper
4 participants