TS2302
Generic type instantiation is excessively deep and possibly infinite.
Broken Code ❌
type Infinite<T> = {
value: T;
next: Infinite<Infinite<T>>;
};
type Result = Infinite<string>;Fixed Code ✔️
type LinkedNode<T> = {
value: T;
next: LinkedNode<T> | null;
};
type Result = LinkedNode<string>;This error occurs when TypeScript detects infinite recursion in type definitions. Restructure your types to avoid unbounded recursion.
