Skip to content

InstanceType<BigIntConstructor> fails with a compilation error and doesn't result in a bigint, as it's supposed to #61272

Closed
@WillAvudim

Description

@WillAvudim

⚙ Compilation target

ESNext (ES2024?)

⚙ Library

typescript 5.7.3

Missing / Incorrect Definition

InstanceType is a built-in utility type that resolves a constructor into the type being constructed.

E.g. InstanceType<StringConstructor> = string, InstanceType<BooleanConstructor> = boolean, InstanceType<DateConstructor> = Date, etc

However, it errors out for InstanceType<BigIntConstructor> with the error:
Type does not satisfy the constraint abstract new (...args: any) => any .

Sample Code

InstanceType<BigIntConstructor>

Documentation Link

https://www.typescriptlang.org/docs/handbook/utility-types.html#instancetypetype

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions