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
TypeScript Version: 3.2.2 (ts playground)
Search Terms: recursive, mapped types, tuple, array
Code
type DeepMap<T extends unknown[], R> = { [K in keyof T]: T[K] extends unknown[] ? DeepMap<T[K], R> : R; }; type tup = [string, [string, [string]]]; type arr = string[][]; type t1 = DeepMap<tup, number>; type t2 = DeepMap<arr, number>;
Expected behavior:
type t1 = [number, [number, [number]]]; type t2 = number[][];
Actual behavior:
type t1 = [number, any]; type t2 = any[];
Playground Link:
Related Issues:
The text was updated successfully, but these errors were encountered:
ahejlsberg
Successfully merging a pull request may close this issue.
TypeScript Version: 3.2.2 (ts playground)
Search Terms: recursive, mapped types, tuple, array
Code
Expected behavior:
Actual behavior:
Playground Link:
Related Issues:
The text was updated successfully, but these errors were encountered: