# Bug Report <!-- Please fill in each section completely. Thank you! --> ### π Search Terms recursive conditional types ### π 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 changed between versions 4.5.5 and 4.6.2 ### β― Playground Link <!-- A link to a TypeScript Playground "Share" link which shows this behavior The TypeScript Workbench can be used for more complex setups, try https://www.typescriptlang.org/dev/bug-workbench/ As a last resort, you can link to a repo, but these will be slower for us to investigate. --> [Playground Link](https://www.typescriptlang.org/play?ts=4.6.2#code/C4TwDgpgBAigrhATiAPAFQHxQLxQN4BQUUA2gApQCWAdlACIQRgDSEIAzuhgLoD8AXFHbBENAOYBuAgF8pBUJChlRAW0rBKAN2jYCASAA+UanAA2p-UbjUAJhABmNCDctCR41yZUAjJK+8A9gGmEACG1K7sID7B-pRiNMByCtAMTKwcXDhQaFAQAB7AELbsSqrqWhBEULzGENqI1fzVxMRGABQA1mwB9jlQAGRuotRiAJQtrUaErbOt5FS03SC9-UPCI2Lcgmjk3HmFxTal7TT2SFAAktTUSGMk3JNzrbUABgAkeGTSAHSfaSw2JxrrdEBhpK8ns8oDs9gciiUoAFvAArCAAY2AUOeb0+3z+eABGU4uzI3HBkOhc0EZCkVOkJGWq1y63co24EiAA) ### π» Code <!-- Please post the relevant code sample here as well--> ```ts type Query<T> = { [P in DeepKeys<T>]?: string; }; type Primitive = | null | undefined | string | number | boolean | symbol | bigint; type DeepKeys<T> = T extends Primitive ? never : | (keyof T & string) | { [P in keyof T & string]: T[P] extends (infer Inner)[] ? `${P}.${DeepKeys<Inner>}` : T[P] extends object ? `${P}.${DeepKeys<T[P]>}` : P; }[keyof T & string]; ``` ### π Actual behavior `Type instantiation is excessively deep and possibly infinite.` at the `${P}.${DeepKeys<T[P]>}` snippet. ### π Expected behavior No error. Type properly resolves to dot-notation keys of input object.