π Search Terms
"getReturnType", "stack overflow", "Maximum call stack size exceeded", "recursive generic function"
π Version & Regression Information
This is happening in v6 and tsgo (I didn't check prior versions)
β― Playground Link
No response
π» Code
Coming from typescript-eslint/typescript-eslint#12705, I created a repro that's agnostic to ESLint:
// A generic function type whose call signature returns the same type,
// instantiated with an accumulated type argument.
type Recursive<T> = <U>() => Recursive<T & U>;
export declare const subject: Recursive<unknown>;
https://github.com/StyleShit/repros/tree/main/ts-getReturnType-stack-overflow
π Actual behavior
Walking the function's signature and return type is failing with "Maximum call stack size exceeded" error
π Expected behavior
Walking should not fail
Additional information about the issue
No response
π Search Terms
"getReturnType", "stack overflow", "Maximum call stack size exceeded", "recursive generic function"
π Version & Regression Information
This is happening in v6 and tsgo (I didn't check prior versions)
β― Playground Link
No response
π» Code
Coming from typescript-eslint/typescript-eslint#12705, I created a repro that's agnostic to ESLint:
https://github.com/StyleShit/repros/tree/main/ts-getReturnType-stack-overflow
π Actual behavior
Walking the function's signature and return type is failing with "Maximum call stack size exceeded" error
π Expected behavior
Walking should not fail
Additional information about the issue
No response