mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Add test
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user