-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
Breaking ChangeWould introduce errors in existing codeWould introduce errors in existing codeBugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue
Milestone
Description
TypeScript Version: 4.1.2
Search Terms:
Code
type BuildTuple<L extends number, T extends any[] = [any]> =
T['length'] extends L ? T : BuildTuple<L, [...T, ...T]>;
type A = BuildTuple<3>Expected behavior:
The type checker completes in a reasonable time, either by succeeding or by reporting "Type instantiation is excessively deep and possibly infinite".
Actual behavior:
The type checker just hangs.
Playground Link:
andrewbranch and SlurpTheo
Metadata
Metadata
Assignees
Labels
Breaking ChangeWould introduce errors in existing codeWould introduce errors in existing codeBugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue