Skip to content

Better error message for invalid bigint literals ending with n#28896

Merged
DanielRosenwasser merged 2 commits into
microsoft:masterfrom
JoshuaKGoldberg:n-identifier-after-numeric-literal-error
Dec 18, 2018
Merged

Better error message for invalid bigint literals ending with n#28896
DanielRosenwasser merged 2 commits into
microsoft:masterfrom
JoshuaKGoldberg:n-identifier-after-numeric-literal-error

Conversation

@JoshuaKGoldberg
Copy link
Copy Markdown
Contributor

Helps with the cases of decimals and exponentials, though not with numbers incorrectly starting with 0.

Fixes #28887.

Helps with the cases of decimals and exponentials, though not with numbers incorrectly starting with `0`.

Fixes microsoft#28887.
Comment thread tests/baselines/reference/parseBigInt.errors.txt
Comment thread src/compiler/scanner.ts
@@ -67,15 +69,19 @@ tests/cases/compiler/identifierStartAfterNumericLiteral.ts(26,5): error TS2304:
~~
!!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal.
3en[null]
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.

This is a great test case.

@DanielRosenwasser
Copy link
Copy Markdown
Member

Thanks!

@DanielRosenwasser DanielRosenwasser merged commit 3edd2d6 into microsoft:master Dec 18, 2018
@JoshuaKGoldberg JoshuaKGoldberg deleted the n-identifier-after-numeric-literal-error branch December 18, 2018 20:08
@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