This commit is contained in:
Anders Hejlsberg
2019-04-09 15:29:51 -10:00
parent c8ff4bd9b3
commit 68eb7b9fe2
@@ -37,6 +37,11 @@ function f3<K extends string>(a: { [P in K]: number }, b: { [key: string]: numbe
a[k] = 1;
}
function f3b<K extends string>(a: { [P in K]: number }, b: { [P in string]: number }, k: K) {
a = b; // Error, index signature doesn't imply properties are present
b = a;
}
function f4<K extends string>(a: { [key: string]: number }[K], b: number) {
a = b;
b = a;