We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Maximum call stack size exceeded", "mapped types"
https://www.typescriptlang.org/play?ts=5.4.2#code/C4TwDgpgBAYg9nAPANQHxQLxQN4CgoFQDaA0lAJYB2UA1hCHAGZTIC6AXLAiqa6gNy4AvrlyhIUAEIBDAE4p0WPIWJkqtekxYcWvKBAAewCJQAmAZyhwARgCsIAY2BQA-FLk8SfKJ3PBZVADmgiK4jACulE7kcNTGfgoAFABu0gA24RCc8EhoAJQ4+FAOseZwaRAAdGlwgSnpmXkhoiWUflDWcpwy8tKUIIo4QoJiEH6JnbJNuEA
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);
Throws an exception
Uncaught (in promise) RangeError: Maximum call stack size exceeded
Either passes type check or reports a problem
No response
The text was updated successfully, but these errors were encountered:
Repros as far back as 4.0, possibly earlier. Wild.
Sorry, something went wrong.
inferReverseMappedType
gabritto
Successfully merging a pull request may close this issue.
π Search Terms
"Maximum call stack size exceeded", "mapped types"
π Version & Regression Information
β― Playground Link
https://www.typescriptlang.org/play?ts=5.4.2#code/C4TwDgpgBAYg9nAPANQHxQLxQN4CgoFQDaA0lAJYB2UA1hCHAGZTIC6AXLAiqa6gNy4AvrlyhIUAEIBDAE4p0WPIWJkqtekxYcWvKBAAewCJQAmAZyhwARgCsIAY2BQA-FLk8SfKJ3PBZVADmgiK4jACulE7kcNTGfgoAFABu0gA24RCc8EhoAJQ4+FAOseZwaRAAdGlwgSnpmXkhoiWUflDWcpwy8tKUIIo4QoJiEH6JnbJNuEA
π» Code
π Actual behavior
Throws an exception
π Expected behavior
Either passes type check or reports a problem
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: