Reputation: 496
Why is this type valid:
export type CircularObj = { [key: string]: CircularObj }
but this type is not:
export type CircularRecord = Record<string, CircularRecord>
I am getting the error TS2456: Type alias 'CircularRecord' circularly references itself.
for CircularRecord, but not for CircularObj, and I am wondering why?
I am using typescript version 4.1.6
Upvotes: 1
Views: 81