We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fa65bd2 commit ee0715aCopy full SHA for ee0715a
1 file changed
tests/cases/conformance/types/mapped/mappedTypeWithAny.ts
@@ -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