Skip to content

Commit f834caf

Browse files
committed
Add tests
1 parent 82a2ee6 commit f834caf

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// @strictNullChecks: true
2+
// @declaration: true
3+
4+
function f1<T>(x: Partial<T>, y: Readonly<T>) {
5+
let obj: {};
6+
obj = x;
7+
obj = y;
8+
}
9+
10+
function f2<T>(x: Partial<T>, y: Readonly<T>) {
11+
let obj: { [x: string]: any };
12+
obj = x;
13+
obj = y;
14+
}
15+
16+
// Repro from #12900
17+
18+
interface Base {
19+
foo: { [key: string]: any };
20+
bar: any;
21+
baz: any;
22+
}
23+
24+
interface E1<T> extends Base {
25+
foo: T;
26+
}
27+
28+
interface Something { name: string, value: string };
29+
interface E2 extends Base {
30+
foo: Partial<Something>; // or other mapped type
31+
}
32+
33+
interface E3<T> extends Base {
34+
foo: Partial<T>; // or other mapped type
35+
}

0 commit comments

Comments
 (0)