Closed
Description
TypeScript Version: 3.7.2 (and also nightly)
Search Terms: circularly references itself
, Record circular reference
Code
type RecursiveTypeA = Record<number, RecursiveTypeA> // error: Type alias 'RecursiveTypeA' circularly references itself.
type RecursiveTypeB = RecursiveTypeB[] // works fine
type RecursiveTypeC = { [index: number]: RecursiveTypeC } // works fine
Expected behavior:
Record type should work like the third example that defines an object with number keys to the recursive value (the key type is irrelevant).
Actual behavior:
Only the Record type fail with circular reference
Playground Link: link
Related Issues: couldn't find any specific related issues
Metadata
Metadata
Assignees
Labels
No labels