-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Allow return type in conditional if body is followed by a colon #48788
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. |
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.
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