# Bug Report <!-- Please fill in each section completely. Thank you! --> ### 🔎 Search Terms <!-- What search terms did you use when trying to find an existing bug report? List them here so people in the future can find this one more easily. --> nested, infer, inference, unknown ### 🕗 Version & Regression Information <!-- When did you start seeing this bug occur? "Bugs" that have existed in TS for a long time are very likely to be FAQs; refer to https://github.com/Microsoft/TypeScript/wiki/FAQ#common-bugs-that-arent-bugs If possible, please try testing the nightly version of TS to see if it's already been fixed. For npm: `typescript@next` This is also the 'Nightly' version in the playground: http://www.typescriptlang.org/play/?ts=Nightly Note: The TypeScript Playground can be used to try older versions of TypeScript. Please keep and fill in the line that best applies: --> - This is a crash - This changed between versions ______ and _______ - This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________ - I was unable to test this on prior versions because _______ ### ⏯ Playground Link [Playground link with relevant code](https://www.typescriptlang.org/play?ts=4.7.0-dev.20220402#code/C4TwDgpgBAsghgcwJYGMA8ANAfFAvFDKCAD2AgDsATAZygG06lyAzCAJygE0AaKAOgFNWHAPoBdXgL5D2UcVAD8XKAC4o5CADd2AbgBQe0JCgAlPLESo0DcgFcAtgCN2YsTgD07qIBlyKLfIA1uQA9gDu5Ibg0CYATObwyOg2Ds5svDGuHl6AoOTqKeyRxiYAzPGWSXR2Ti68dJlQnlC5ValAA) ### 💻 Code ```ts type Magic<X> = X extends [[infer Y, ...infer _], ...infer _] ? Y : never; type R = Magic<[[number]]> // ❌ unknown type R2 = Magic<[[number, 2]]> // ✅ number type R3 = Magic<[[number], []]> // ✅ number ``` ### 🙁 Actual behavior - `Magic<[[whatever]]>` is `unknown` ### 🙂 Expected behavior - `Magic<[[whatever]]>` should be `whatever`