GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Revert "Don't treat a colon in a conditional expression branch as part of an arrow function" by jakebailey · Pull Request #48940 · microsoft/TypeScript

Conversation

@jakebailey

@jakebailey Jake Bailey (jakebailey) commented May 3, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Reopens #16241
Fixes #48733 (by reverting what broke it)

#47550 breaks some code out in the wild that I didn't have tests for, and that's not good unless we explicitly decide to allow/disallow some specific syntax.

It's too close to 4.8's RC, and we haven't the decision as to how we want to solve the ambiguity, i.e. choosing one of the options listed in #48733 (comment).

Just revert my incomplete bugfix for now, with the expectation that this is reapplied with one of the three PRs above.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@jakebailey
Revert "Don't treat a colon in a conditional expression branch as par…
70c7315
…t of an arrow function (microsoft#47550)"

This reverts commit 2dede20.
@jakebailey
Jake Bailey (jakebailey) requested review from Daniel Rosenwasser (DanielRosenwasser), Ryan Cavanaugh (RyanCavanaugh) and Nathan Shively-Sanders (sandersn) May 3, 2022 17:53
@typescript-bot TypeScript Bot (typescript-bot) assigned Jake Bailey (jakebailey) May 3, 2022
@typescript-bot TypeScript Bot (typescript-bot) added Author: Team For Milestone Bug PRs that fix a bug with a specific milestone labels May 3, 2022
@jakebailey

Jake Bailey (jakebailey) commented May 3, 2022

Copy link
Copy Markdown
Member Author

This PR is currently a plain revert, but I'm thinking it would be best to leave the tests in place, and add the tests from the three PRs in #48733 (comment). That way, we lock things in and then can see the diff in a future change.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jakebailey
Restore tests, add new tests for new broken code
261aeab
@jakebailey

Jake Bailey (jakebailey) commented May 3, 2022

Copy link
Copy Markdown
Member Author

Restored the tests and added the ones from the other PR for #48733.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser) approved these changes May 3, 2022
View reviewed changes
@jakebailey Jake Bailey (jakebailey) mentioned this pull request May 4, 2022
Allow return type in conditional if body is followed by a colon #48788
Closed
sandersn
Nathan Shively-Sanders (sandersn) approved these changes May 4, 2022
View reviewed changes
@jakebailey
Jake Bailey (jakebailey) merged commit f579f33 into microsoft:main May 4, 2022
@jakebailey
Jake Bailey (jakebailey) deleted the revert-47550 branch May 4, 2022 22:01
This was referenced May 4, 2022
Don't treat a colon in a conditional expression branch as part of an arrow function #47550
Merged
fix(ecma_parser) Allow arrow func without parenthesisised param in conditional for TS swc-project/swc#4138
Merged
[bug] Ternary + arrow function is not correctly parsed #16241
Closed
@williamtetlow William Tetlow (williamtetlow) mentioned this pull request May 5, 2022
fix(es/parser): Revert "Allow arrows without parenthesized param in typescript ( #4138)" swc-project/swc#4540
Merged
@jakebailey Jake Bailey (jakebailey) mentioned this pull request Jun 13, 2022
Fix arrow expressions in conditional expressions, take N+1 #49531
Merged
@microsoft Microsoft (microsoft) locked as resolved and limited conversation to collaborators Oct 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@sandersn Nathan Shively-Sanders (sandersn) sandersn approved these changes
@DanielRosenwasser Daniel Rosenwasser (DanielRosenwasser) DanielRosenwasser approved these changes
@RyanCavanaugh Ryan Cavanaugh (RyanCavanaugh) Awaiting requested review from RyanCavanaugh

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@jakebailey Jake Bailey (jakebailey)

Labels

Author: Team For Milestone Bug PRs that fix a bug with a specific milestone

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[4.7-beta] Parsing failure for arrow function expr in conditional expr

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@jakebailey @sandersn @DanielRosenwasser @typescript-bot
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.