- Notifications
You must be signed in to change notification settings - Fork 13.2k
Fix emit for optional chain with non-null assertion#36539
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
DanielRosenwasser commented Jan 31, 2020
Why did we decide not to change the types here? Seems like we really shouldn't have one without the other. |
rbuckton commented Feb 1, 2020
There are some odd quirks to consider if we change the precedence of // note: `undefined*` indicates an `undefined` that was added to the type by `?.`declareconsta: undefined|{b: number|null};// current behavior a!.b// number | nulla!.b!// numbera?.b// number | null | undefined*a?.b!// number// proposed behavior (differences) a?.b!// number | undefined*If we give |
rbuckton commented Feb 28, 2020
With the latest changes, a postfix- declareconsta: undefined|{b: {c: number}|null};a?.b.c;// errora?.b!.c;// number | undefineda?.b!;//{c: number }This best matches user expectations. |
# Conflicts: # src/compiler/debug.ts
DanielRosenwasser commented Feb 28, 2020
@typescript-bot pack this |
typescript-bot commented Feb 28, 2020 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Heya @DanielRosenwasser, I've started to run the tarball bundle task on this PR at 4214548. You can monitor the build here. |
DanielRosenwasser commented Feb 28, 2020
Do we have tests for letx=a?.b!(); |
elibarzilay left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(To be taken with plenty of salt.)
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
typescript-bot commented Feb 28, 2020 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Hey @DanielRosenwasser, I've packed this into an installable tgz. You can install it for testing by referencing it in your and then running There is also a playground for this build. |
sandersn commented Mar 12, 2020
@rbuckton is this ready to merge? |
DanielRosenwasser commented Mar 25, 2020
@rbuckton@RyanCavanaugh this should have landed in the beta |
DanielRosenwasser commented Mar 25, 2020
@typescript-bot user test this |
typescript-bot commented Mar 25, 2020 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Heya @DanielRosenwasser, I've started to run the parallelized community code test suite on this PR at 4214548. You can monitor the build here. |
typescript-bot commented Mar 25, 2020 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Heya @DanielRosenwasser, I've started to run the extended test suite on this PR at 4214548. You can monitor the build here. |
DanielRosenwasser commented Mar 25, 2020
@typescript-bot cherry-pick this to release-3.9 |
typescript-bot commented Mar 25, 2020 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Heya @DanielRosenwasser, I've started to run the task to cherry-pick this into |
typescript-bot commented Mar 25, 2020
Hey @DanielRosenwasser, I've opened #37599 for you. |
typescript-bot commented Mar 25, 2020
The user suite test run you requested has finished and failed. I've opened a PR with the baseline diff from master. |
rbuckton commented Mar 25, 2020
@DanielRosenwasser I manually cherry-picked the last commit over, which just addresses @elibarzilay's comments about a dead-code branch and fixes a comment. |
Fixes emit for optional chaining when a non-null assertion is present in the chain:
Fixes#36031