Skip to content

Commit 68eb7b9

Browse files
committed
Add test
1 parent c8ff4bd commit 68eb7b9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ function f3<K extends string>(a: { [P in K]: number }, b: { [key: string]: numbe
3737
a[k] = 1;
3838
}
3939

40+
function f3b<K extends string>(a: { [P in K]: number }, b: { [P in string]: number }, k: K) {
41+
a = b; // Error, index signature doesn't imply properties are present
42+
b = a;
43+
}
44+
4045
function f4<K extends string>(a: { [key: string]: number }[K], b: number) {
4146
a = b;
4247
b = a;

0 commit comments

Comments
 (0)