diff --git a/tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts b/tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts index 2794ec66dd4d5..5251a83bb0611 100644 --- a/tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts +++ b/tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts @@ -131,5 +131,10 @@ function fn2>(param: T, cb: (element: T[number]) => void // Repro from #31149 function fn3>(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() { + let x: Array[K] = 'abc'; + let y: ReadonlyArray[K] = 'abc'; }