Add additional tests

This commit is contained in:
Anders Hejlsberg 2019-04-28 14:12:00 -07:00
parent 6d60f699ca
commit bbce336268

View File

@ -131,5 +131,10 @@ function fn2<T extends Array<string>>(param: T, cb: (element: T[number]) => void
// Repro from #31149
function fn3<T extends ReadonlyArray<string>>(param: T, cb: (element: T[number]) => void) {
cb(param[0]); // Argument of type 'string' is not assignable to parameter of type 'T[number]'.
cb(param[0]);
}
function fn4<K extends number>() {
let x: Array<string>[K] = 'abc';
let y: ReadonlyArray<string>[K] = 'abc';
}