-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue
Milestone
Description
π Search Terms
"Maximum call stack size exceeded", "mapped types"
π Version & Regression Information
- This is a crash
β― Playground Link
π» Code
type Foo<V> = {
[K in keyof V]: Foo<V[K]>;
}
type Bar<V> = {
[K in keyof V]: V[K] extends object ? Bar<V[K]> : string;
}
function test<V>(value: Foo<V>) {
console.log(value);
}
const bar: Bar<any> = {};
test(bar);π Actual behavior
Throws an exception
Uncaught (in promise) RangeError: Maximum call stack size exceeded
π Expected behavior
Either passes type check or reports a problem
Additional information about the issue
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue