mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-12 04:17:34 -06:00
Add additional tests
This commit is contained in:
parent
6d60f699ca
commit
bbce336268
@ -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';
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user