Skip to content

Commit 647e183

Browse files
committed
Add tests
1 parent 7e7057a commit 647e183

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

tests/cases/conformance/types/mapped/mappedTypesAndObjects.ts

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,33 @@ function f2<T>(x: Partial<T>, y: Readonly<T>) {
1313
obj = y;
1414
}
1515

16+
function f3<T>(x: Partial<T>) {
17+
x = {};
18+
}
19+
1620
// Repro from #12900
1721

1822
interface Base {
19-
foo: { [key: string]: any };
20-
bar: any;
21-
baz: any;
23+
foo: { [key: string]: any };
24+
bar: any;
25+
baz: any;
2226
}
2327

2428
interface E1<T> extends Base {
25-
foo: T;
29+
foo: T;
2630
}
2731

2832
interface Something { name: string, value: string };
2933
interface E2 extends Base {
30-
foo: Partial<Something>; // or other mapped type
34+
foo: Partial<Something>; // or other mapped type
3135
}
3236

3337
interface E3<T> extends Base {
34-
foo: Partial<T>; // or other mapped type
35-
}
38+
foo: Partial<T>; // or other mapped type
39+
}
40+
41+
// Repro from #13747
42+
43+
class Form<T> {
44+
private values: {[P in keyof T]?: T[P]} = {}
45+
}

0 commit comments

Comments
 (0)