From bbce336268b3b1be7bfae663dfdff928ab1c0846 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sun, 28 Apr 2019 14:12:00 -0700 Subject: [PATCH] Add additional tests --- .../conformance/types/keyof/keyofAndIndexedAccess2.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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'; }