Skip to content

Allow arrow function parameter parsing to bail out during speculation - #39014

Closed
Wesley Wigham (weswigham) wants to merge 1 commit into
microsoft:mainfrom
weswigham:fix-arrow-lookahead
Closed

Wesley Wigham (weswigham) wants to merge 1 commit into
microsoft:mainfrom
weswigham:fix-arrow-lookahead

Conversation

@weswigham

Copy link
Copy Markdown
Member

Fixes #32914

@orta

Copy link
Copy Markdown
Contributor

Impressive, almost every line of the change is now a conflict 👍🏻

Comment thread src/compiler/parser.ts
// And think that "(b =>" was actually a parenthesized arrow function with a missing
// close paren.
if (!fillSignature(SyntaxKind.ColonToken, isAsync, node) && !allowAmbiguity) {
if (!fillSignature(SyntaxKind.ColonToken, isAsync, node, allowAmbiguity) && !allowAmbiguity) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm looking into rebasing this PR, I got reasonably far, but all of the signature stuff has been completely removed from the codebase - so I'm going to wait on this till our pairing session

@jakebailey

Copy link
Copy Markdown
Member

Wesley Wigham (@weswigham) Do you want to pick this PR up again, or just close it? I also tried to sit down to rebase/merge main back in, but wasn't very successful. Might just need a redo (or you to fix it if you know the intent behind some of the changes).

@weswigham

Copy link
Copy Markdown
Member Author

if you know the intent behind some of the changes

Allow some parser functions to return undefined, so that can bubble up and be used to trigger a failed speculative parse.

@jakebailey

Copy link
Copy Markdown
Member

I'm going to close this in favor of #48493, if that's alright. This was a bit too hard to rebase on the branch so I did it by hand against main's parser.

@microsoft Microsoft (microsoft) locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

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

4 participants