Allow return type in conditional if body is followed by a colon#48788
Allow return type in conditional if body is followed by a colon#48788jakebailey wants to merge 5 commits intomicrosoft:mainfrom
Conversation
|
@typescript-bot pack this |
|
Heya @jakebailey, I've started to run the tarball bundle task on this PR at 2398762. You can monitor the build here. |
|
Hey @jakebailey, 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 and an npm module you can use via |
|
Demo: Playground Link |
|
This change is intended for 4.8, right? |
|
Yes, 4.8, given we took too long to make a decision. There's a revert PR for the original fix I made (#48940) and I'll rebase these three PRs to make them correct again. |
sandersn
left a comment
There was a problem hiding this comment.
This looks like it does what it says, although I recall that we wanted to parse JS in a spec-compliant way. Does this need a follow-up PR for that?
|
Sorry, yes, I don't have the final fix yet. Likely this PR does what we want, but I need to really check. |
This modifies my logic in #47550 allow an arrow function with a return type so long as that arrow function is immediately followed by another colon, which is instead chosen to terminate the conditional expression.
Fixes #48733