Skip to content

Commit

Permalink
Add additional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ahejlsberg committed Apr 28, 2019
1 parent 6d60f69 commit bbce336
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -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';
}

0 comments on commit bbce336

Please sign in to comment.