We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9c401b4 commit 3050c62Copy full SHA for 3050c62
tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts
@@ -127,3 +127,9 @@ function fn<T extends {elements: Array<string>} | {elements: Array<number>}>(par
127
function fn2<T extends Array<string>>(param: T, cb: (element: T[number]) => void) {
128
cb(param[0]);
129
}
130
+
131
+// Repro from #31149
132
133
+function fn3<T extends ReadonlyArray<string>>(param: T, cb: (element: T[number]) => void) {
134
+ cb(param[0]); // Argument of type 'string' is not assignable to parameter of type 'T[number]'.
135
+}
0 commit comments