Typescript reports circular dependency error in Record type but not in dynamic object type
I have two kinds of type, while using the Record, typescript is giving circular reference error. But when I do the same with a dynamic object, no error pops. Why typescript show two completely contrasting behaviours?
The expected output should be error on both or on none.
type ScopeItem =
| string
| {
all: string;
team: string;
};
type ScopesTree = Record<string, ScopeItem | Record<string, ScopesTree>>; // error: Type alias 'ScopesTree' circular references itself
type ScopesTree2 = Record<string, ScopeItem | { [key: string]: ScopesTree2 }>; // no error

Is it something to do with the computation of the typescript type in both the cases? Please enlighten.
Thanks.
Duplicate of #41164.
There's a whole template you're prompted to fill out when you open a bug here; did you miss it?
This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.