// @strict: true // @declaration: true // Repro from #17456 type StringContains = ({ [K in S]: 'true' } & { [key: string]: 'false'})[L]; type ObjectHasKey = StringContains, L>; type A = ObjectHasKey; type B = ObjectHasKey<[string, number], '1'>; // "true" type C = ObjectHasKey<[string, number], '2'>; // "false" type D = A<[string]>; // "true" // Error, "false" not handled type E = { true: 'true' }[ObjectHasKey]; type Juxtapose = ({ true: 'otherwise' } & { [k: string]: 'true' })[ObjectHasKey]; // Error, "otherwise" is missing type DeepError = { true: 'true' }[Juxtapose]; type DeepOK = { true: 'true', otherwise: 'false' }[Juxtapose];