// @strict: true // @declaration: true // Repro from #17456 type StringContains = ( { [K in S]: 'true' } & { [key: string]: 'false' } )[L] type ObjectHasKey = StringContains, L> type First = ObjectHasKey; // Should be deferred type T1 = ObjectHasKey<{ a: string }, 'a'>; // 'true' type T2 = ObjectHasKey<{ a: string }, 'b'>; // 'false' // Verify that mapped type isn't eagerly resolved in type-to-string operation declare function f1(a: A, b: B): { [P in A | B]: any }; function f2(a: A) { return f1(a, 'x'); } function f3(x: 'a' | 'b') { return f2(x); }