Skip to content

Allow method return types to end with a digit - #199

Closed
Marin Marinov (gcnew) wants to merge 2 commits into
microsoft:masterfrom
gcnew:master
Closed

Allow method return types to end with a digit#199
Marin Marinov (gcnew) wants to merge 2 commits into
microsoft:masterfrom
gcnew:master

Conversation

@gcnew

@gcnew Marin Marinov (gcnew) commented Jun 30, 2016

Copy link
Copy Markdown

Syntax coloring fails if method return type ends with a digit. This pull request allows digits to be the last character in type-annotation.end regular expression.

Fixes microsoft/TypeScript#9444 and should be in line with the to-be-added numeric literal types microsoft/TypeScript#9407.

@msftclas

Hi Marin Marinov (@gcnew), I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!

This seems like a small (but important) contribution, so no Contribution License Agreement is required at this point. Real humans will now evaluate your PR.

TTYL, MSBOT;

@msftclas

Marin Marinov (@gcnew), Thanks for signing the contribution license agreement so quickly! Actual humans will now validate the agreement and then evaluate the PR.

Thanks, MSBOT;

^^public ^^testMethodReturnType12(): number | string [] { ^^return }
^^public ^^testMethodReturnType13(): [number, number] | string [] { ^^return [""] }
} No newline at end of file
^^public ^^testMethodReturnType14(): EndsWithDigit1 { ^^return 123 }

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.

Can you add a check to scope of 123 and after 123, like --

^^return ^^123 ^^} 

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done.

@mhegazy

Copy link
Copy Markdown
Contributor

Sorry for the delay, this should be fixed now by #257

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants