fix(compiler-cli): enable narrowing of using type guard methods#44447
Closed
JoostK wants to merge 1 commit intoangular:masterfrom
Closed
fix(compiler-cli): enable narrowing of using type guard methods#44447JoostK wants to merge 1 commit intoangular:masterfrom
JoostK wants to merge 1 commit intoangular:masterfrom
Conversation
crisbeto
reviewed
Jan 7, 2022
Member
There was a problem hiding this comment.
Would we have to do the same for KeyedRead?
Member
Author
There was a problem hiding this comment.
Good question, I had to check and TS doesn't seem to narrow those:
The changes in 2028c39 caused method calls to be emitted using additional parenthesis into the TCB, which in turn prevented proper type narrowing when the method acts as a type guard. This commit special-cases method calls from property reads to avoid the additional parenthesis. Fixes angular#44353
ed226d1 to
7161a74
Compare
Contributor
|
This PR was merged into the repository by commit 1a91218. |
atscott
pushed a commit
that referenced
this pull request
Jan 10, 2022
The changes in 2028c39 caused method calls to be emitted using additional parenthesis into the TCB, which in turn prevented proper type narrowing when the method acts as a type guard. This commit special-cases method calls from property reads to avoid the additional parenthesis. Fixes #44353 PR Close #44447
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The changes in 2028c39 caused method
calls to be emitted using additional parenthesis into the TCB, which in
turn prevented proper type narrowing when the method acts as a type
guard. This commit special-cases method calls from property reads to
avoid the additional parenthesis.
Fixes #44353