diff --git a/tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts b/tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts index 356e0a42ae9b4..2794ec66dd4d5 100644 --- a/tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts +++ b/tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts @@ -127,3 +127,9 @@ function fn} | {elements: Array}>(par function fn2>(param: T, cb: (element: T[number]) => void) { cb(param[0]); } + +// 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]'. +}