// @declaration: true // Repro from #12513 function f1(obj: { [P in K]: T }, k: K) { const b = k in obj; let k1: K; for (k1 in obj) { let x1 = obj[k1]; } for (let k2 in obj) { let x2 = obj[k2]; } } function f2(obj: { [P in keyof T]: T[P] }, k: keyof T) { const b = k in obj; let k1: keyof T; for (k1 in obj) { let x1 = obj[k1]; } for (let k2 in obj) { let x2 = obj[k2]; } } function f3(obj: { [P in K]: T[P] }, k: K) { const b = k in obj; let k1: K; for (k1 in obj) { let x1 = obj[k1]; } for (let k2 in obj) { let x2 = obj[k2]; } }