Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 2 src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10349,7 +10349,7 @@ namespace ts {
t.flags & TypeFlags.Intersection ? getApparentTypeOfIntersectionType(<IntersectionType>t) :
t.flags & TypeFlags.StringLike ? globalStringType :
t.flags & TypeFlags.NumberLike ? globalNumberType :
t.flags & TypeFlags.BigIntLike ? getGlobalBigIntType(/*reportErrors*/ languageVersion >= ScriptTarget.ESNext) :
t.flags & TypeFlags.BigIntLike ? getGlobalBigIntType(/*reportErrors*/ languageVersion >= ScriptTarget.ES2020) :
t.flags & TypeFlags.BooleanLike ? globalBooleanType :
t.flags & TypeFlags.ESSymbolLike ? getGlobalESSymbolType(/*reportErrors*/ languageVersion >= ScriptTarget.ES2015) :
t.flags & TypeFlags.NonPrimitive ? emptyObjectType :
Expand Down
13 changes: 13 additions & 0 deletions 13 tests/baselines/reference/bigintMissingES2019.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//// [bigintMissingES2019.ts]
declare function test<A, B extends A>(): void;

test<{t?: string}, object>();
test<{t?: string}, bigint>();

// no error when bigint is used even when ES2020 lib is not present


//// [bigintMissingES2019.js]
test();
test();
// no error when bigint is used even when ES2020 lib is not present
17 changes: 17 additions & 0 deletions 17 tests/baselines/reference/bigintMissingES2019.symbols
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
=== tests/cases/conformance/es2020/bigintMissingES2019.ts ===
declare function test<A, B extends A>(): void;
>test : Symbol(test, Decl(bigintMissingES2019.ts, 0, 0))
>A : Symbol(A, Decl(bigintMissingES2019.ts, 0, 22))
>B : Symbol(B, Decl(bigintMissingES2019.ts, 0, 24))
>A : Symbol(A, Decl(bigintMissingES2019.ts, 0, 22))

test<{t?: string}, object>();
>test : Symbol(test, Decl(bigintMissingES2019.ts, 0, 0))
>t : Symbol(t, Decl(bigintMissingES2019.ts, 2, 6))

test<{t?: string}, bigint>();
>test : Symbol(test, Decl(bigintMissingES2019.ts, 0, 0))
>t : Symbol(t, Decl(bigintMissingES2019.ts, 3, 6))

// no error when bigint is used even when ES2020 lib is not present

16 changes: 16 additions & 0 deletions 16 tests/baselines/reference/bigintMissingES2019.types
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
=== tests/cases/conformance/es2020/bigintMissingES2019.ts ===
declare function test<A, B extends A>(): void;
>test : <A, B extends A>() => void

test<{t?: string}, object>();
>test<{t?: string}, object>() : void
>test : <A, B extends A>() => void
>t : string

test<{t?: string}, bigint>();
>test<{t?: string}, bigint>() : void
>test : <A, B extends A>() => void
>t : string

// no error when bigint is used even when ES2020 lib is not present

12 changes: 12 additions & 0 deletions 12 tests/baselines/reference/bigintMissingES2020.errors.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
error TS2318: Cannot find global type 'BigInt'.


!!! error TS2318: Cannot find global type 'BigInt'.
==== tests/cases/conformance/es2020/bigintMissingES2020.ts (0 errors) ====
declare function test<A, B extends A>(): void;

test<{t?: string}, object>();
test<{t?: string}, bigint>();

// should have global error when bigint is used but ES2020 lib is not present

13 changes: 13 additions & 0 deletions 13 tests/baselines/reference/bigintMissingES2020.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//// [bigintMissingES2020.ts]
declare function test<A, B extends A>(): void;

test<{t?: string}, object>();
test<{t?: string}, bigint>();

// should have global error when bigint is used but ES2020 lib is not present


//// [bigintMissingES2020.js]
test();
test();
// should have global error when bigint is used but ES2020 lib is not present
17 changes: 17 additions & 0 deletions 17 tests/baselines/reference/bigintMissingES2020.symbols
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
=== tests/cases/conformance/es2020/bigintMissingES2020.ts ===
declare function test<A, B extends A>(): void;
>test : Symbol(test, Decl(bigintMissingES2020.ts, 0, 0))
>A : Symbol(A, Decl(bigintMissingES2020.ts, 0, 22))
>B : Symbol(B, Decl(bigintMissingES2020.ts, 0, 24))
>A : Symbol(A, Decl(bigintMissingES2020.ts, 0, 22))

test<{t?: string}, object>();
>test : Symbol(test, Decl(bigintMissingES2020.ts, 0, 0))
>t : Symbol(t, Decl(bigintMissingES2020.ts, 2, 6))

test<{t?: string}, bigint>();
>test : Symbol(test, Decl(bigintMissingES2020.ts, 0, 0))
>t : Symbol(t, Decl(bigintMissingES2020.ts, 3, 6))

// should have global error when bigint is used but ES2020 lib is not present

16 changes: 16 additions & 0 deletions 16 tests/baselines/reference/bigintMissingES2020.types
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
=== tests/cases/conformance/es2020/bigintMissingES2020.ts ===
declare function test<A, B extends A>(): void;
>test : <A, B extends A>() => void

test<{t?: string}, object>();
>test<{t?: string}, object>() : void
>test : <A, B extends A>() => void
>t : string

test<{t?: string}, bigint>();
>test<{t?: string}, bigint>() : void
>test : <A, B extends A>() => void
>t : string

// should have global error when bigint is used but ES2020 lib is not present

12 changes: 12 additions & 0 deletions 12 tests/baselines/reference/bigintMissingESNext.errors.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
error TS2318: Cannot find global type 'BigInt'.


!!! error TS2318: Cannot find global type 'BigInt'.
==== tests/cases/conformance/es2020/bigintMissingESNext.ts (0 errors) ====
declare function test<A, B extends A>(): void;

test<{t?: string}, object>();
test<{t?: string}, bigint>();

// should have global error when bigint is used but ES2020 lib is not present

13 changes: 13 additions & 0 deletions 13 tests/baselines/reference/bigintMissingESNext.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//// [bigintMissingESNext.ts]
declare function test<A, B extends A>(): void;

test<{t?: string}, object>();
test<{t?: string}, bigint>();

// should have global error when bigint is used but ES2020 lib is not present


//// [bigintMissingESNext.js]
test();
test();
// should have global error when bigint is used but ES2020 lib is not present
17 changes: 17 additions & 0 deletions 17 tests/baselines/reference/bigintMissingESNext.symbols
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
=== tests/cases/conformance/es2020/bigintMissingESNext.ts ===
declare function test<A, B extends A>(): void;
>test : Symbol(test, Decl(bigintMissingESNext.ts, 0, 0))
>A : Symbol(A, Decl(bigintMissingESNext.ts, 0, 22))
>B : Symbol(B, Decl(bigintMissingESNext.ts, 0, 24))
>A : Symbol(A, Decl(bigintMissingESNext.ts, 0, 22))

test<{t?: string}, object>();
>test : Symbol(test, Decl(bigintMissingESNext.ts, 0, 0))
>t : Symbol(t, Decl(bigintMissingESNext.ts, 2, 6))

test<{t?: string}, bigint>();
>test : Symbol(test, Decl(bigintMissingESNext.ts, 0, 0))
>t : Symbol(t, Decl(bigintMissingESNext.ts, 3, 6))

// should have global error when bigint is used but ES2020 lib is not present

16 changes: 16 additions & 0 deletions 16 tests/baselines/reference/bigintMissingESNext.types
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
=== tests/cases/conformance/es2020/bigintMissingESNext.ts ===
declare function test<A, B extends A>(): void;
>test : <A, B extends A>() => void

test<{t?: string}, object>();
>test<{t?: string}, object>() : void
>test : <A, B extends A>() => void
>t : string

test<{t?: string}, bigint>();
>test<{t?: string}, bigint>() : void
>test : <A, B extends A>() => void
>t : string

// should have global error when bigint is used but ES2020 lib is not present

8 changes: 8 additions & 0 deletions 8 tests/cases/conformance/es2020/bigintMissingES2019.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// @target: es2019
// @lib: dom,es2019
declare function test<A, B extends A>(): void;

test<{t?: string}, object>();
test<{t?: string}, bigint>();

// no error when bigint is used even when ES2020 lib is not present
8 changes: 8 additions & 0 deletions 8 tests/cases/conformance/es2020/bigintMissingES2020.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// @target: es2020
// @lib: dom,es2017
declare function test<A, B extends A>(): void;

test<{t?: string}, object>();
test<{t?: string}, bigint>();

// should have global error when bigint is used but ES2020 lib is not present
8 changes: 8 additions & 0 deletions 8 tests/cases/conformance/es2020/bigintMissingESNext.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// @target: esnext
// @lib: dom,es2017
declare function test<A, B extends A>(): void;

test<{t?: string}, object>();
test<{t?: string}, bigint>();

// should have global error when bigint is used but ES2020 lib is not present
Morty Proxy This is a proxified and sanitized view of the page, visit original site.