<!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨 Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Even if you think you've found a *bug*, please read the FAQ first, especially the Common "Bugs" That Aren't Bugs section! Please help us by doing the following steps before logging an issue: * Search: https://github.com/Microsoft/TypeScript/search?type=Issues * Read the FAQ: https://github.com/Microsoft/TypeScript/wiki/FAQ Please fill in the *entire* template below. --> <!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. --> **TypeScript Version:** 3.2.2 (ts playground) <!-- Search terms you tried before logging this (so others can find this issue more easily) --> **Search Terms:** recursive, mapped types, tuple, array **Code** ```ts 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:** ```ts type t1 = [number, [number, [number]]]; type t2 = number[][]; ``` **Actual behavior:** ```ts type t1 = [number, any]; type t2 = any[]; ``` [**Playground Link:**](https://www.typescriptlang.org/play/index.html#src=type%20DeepMap%3CT%20extends%20unknown%5B%5D%2C%20R%3E%20%3D%20%7B%0D%0A%20%20%5BK%20in%20keyof%20T%5D%3A%20T%5BK%5D%20extends%20unknown%5B%5D%20%3F%20DeepMap%3CT%5BK%5D%2C%20R%3E%20%3A%20R%3B%0D%0A%7D%3B%0D%0A%0D%0Atype%20tup%20%3D%20%5Bstring%2C%20%5Bstring%2C%20%5Bstring%5D%5D%5D%3B%0D%0Atype%20arr%20%3D%20string%5B%5D%5B%5D%3B%0D%0A%0D%0Atype%20t1%20%3D%20DeepMap%3Ctup%2C%20number%3E%3B%20%2F%2F%20%5Bnumber%2C%20any%5D%20inferred%0D%0Atype%20t2%20%3D%20DeepMap%3Carr%2C%20number%3E%3B%20%2F%2F%20any%5B%5D%20inferred%0D%0A) <!-- A link to a TypeScript Playground "Share" link which demonstrates this behavior --> **Related Issues:** <!-- Did you find other bugs that looked similar? -->