Skip to content

BigInt should not be a subtype of an object type #36155

Closed
@Vbitz

Description

@Vbitz

TypeScript Version: 3.8.0-dev.20200111

Search Terms: "BigInt"

Code

declare function test<A, B extends A>(): void;

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

Expected behavior: bigint should behave like number.

Actual behavior: BigInt instead behaves like a object.

Playground Link: https://www.typescriptlang.org/play/?target=99&ts=3.8.0-dev.20200111#code/CYUwxgNghgTiAEAzArgOzAFwJYHtXwxAGcMAeAQQBp4AheEAD0NWCPnID4AKASgC54ANxxZgAbgBQEwiVIBvDAH4BJGFlQBzAL7UcAIwBW4DNx6SZZBcvir126nqwb1J3ueKWlKjGs074qMgAtnogMKZiQA

Related Issues:

Main BigInt Issue: #33871

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptDesign LimitationConstraints of the existing architecture prevent this from being fixed

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions