parse less than token rather than left shift in context of type argum… by Kingwl · Pull Request #26653 · microsoft/TypeScript · GitHub
Skip to content

parse less than token rather than left shift in context of type argum… - #26653

Merged
Ryan Cavanaugh (RyanCavanaugh) merged 6 commits into
microsoft:masterfrom
Kingwl:improve_type_arguments_parser_1
Jan 24, 2019
Merged

parse less than token rather than left shift in context of type argum…#26653
Ryan Cavanaugh (RyanCavanaugh) merged 6 commits into
microsoft:masterfrom
Kingwl:improve_type_arguments_parser_1

Conversation

@Kingwl

@Kingwl Wenlu Wang (Kingwl) commented Aug 24, 2018

Copy link
Copy Markdown
Contributor

…ents

Fixes #23996

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Disgustingly, the corresponding method for a greater-than is called reScanGreaterToken. Not sure if we should be consistent here.

@DanielRosenwasser Daniel Rosenwasser (DanielRosenwasser) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's actually not just type references that this needs to account for - can you add a test case for call type arguments as well?

function foo<T>(x: T) {}

// Both should be equivalent
foo< <T>(x: T) => void>();
foo<<T>(x: T) => void>();

@Kingwl

Copy link
Copy Markdown
Contributor Author

Comment thread src/compiler/parser.ts Outdated
return currentToken = scanner.reScanTemplateToken();
}

function reScanLesserToken(): SyntaxKind {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

reScanLessThanToken

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just a rename please

@Kingwl

Copy link
Copy Markdown
Contributor Author

@RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh) merged commit 2f6c65e into microsoft:master Jan 24, 2019
@Kingwl
Wenlu Wang (Kingwl) deleted the improve_type_arguments_parser_1 branch January 24, 2019 03:21
@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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants