-
Notifications
You must be signed in to change notification settings - Fork 12.9k
BigInt support #25886
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
BigInt support #25886
Changes from 1 commit
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
0c1bf31
Declaration files for BigInt
calebsander ece27eb
Utilities for PseudoBigInt
calebsander 3e10ded
Add diagnostic messages for bigints
calebsander ac2a118
Add bigint type
calebsander 0499f5d
Add "bigint" to `typeof x` in baselines
calebsander 188c078
Scan bigint literals
calebsander 95c24c6
experimentalBigInt compiler flag
calebsander a931313
Add bigint tests
calebsander 28e9ec4
Address review comments
calebsander 6f97fb5
Fix error numbers
8000
calebsander ecd1245
Add test for bigint property
calebsander 6c59a3b
Fix ambient initializer emit for bigint
calebsander bb99c41
Don't error on bigint literal used in type
calebsander File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev
Previous commit
Don't error on bigint literal used in type
- Loading branch information
commit bb99c4123003ade3e471cf17472be6d3f72d96ff
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 7 additions & 9 deletions
16
tests/baselines/reference/warnExperimentalBigIntLiteral.errors.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
//// [warnExperimentalBigIntLiteral.ts] | ||
const normalNumber = 123; // should not error | ||
let bigintType: bigint; // should not error | ||
let bigintLiteralType: 123n; // should error when used as type | ||
let bigintLiteralType: 123n; // should not error when used as type | ||
let bigintNegativeLiteralType: -123n; // should not error when used as type | ||
const bigintNumber = 123n * 0b1111n + 0o444n * 0x7fn; // each literal should error | ||
|
||
//// [warnExperimentalBigIntLiteral.js] | ||
const normalNumber = 123; // should not error | ||
let bigintType; // should not error | ||
let bigintLiteralType; // should error when used as type | ||
let bigintLiteralType; // should not error when used as type | ||
let bigintNegativeLiteralType; // should not error when used as type | ||
const bigintNumber = 123n * 15n + 292n * 0x7fn; // each literal should error |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Uh oh!
There was an error while loading. Please reload this page.