Skip to content

Commit ee0715a

Browse files
committed
Add tests
1 parent fa65bd2 commit ee0715a

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// @strict: true
2+
// @declaration: true
3+
4+
type Item = { value: string };
5+
type ItemMap<T> = { [P in keyof T]: Item };
6+
7+
declare let x0: keyof any;
8+
declare let x1: { [P in any]: Item };
9+
declare let x2: { [P in string]: Item };
10+
declare let x3: { [P in keyof any]: Item };
11+
declare let x4: ItemMap<any>;
12+
13+
// Repro from #19152
14+
15+
type Data = {
16+
value: string;
17+
}
18+
19+
type StrictDataMap<T> = {
20+
[P in keyof T]: Data
21+
}
22+
23+
declare let z: StrictDataMap<any>;
24+
for (let id in z) {
25+
let data = z[id];
26+
let x = data.notAValue; // Error
27+
}

0 commit comments

Comments
 (0)