From 9f83958dbe05dfaf2b3072e6cece68c7d5d7b1e9 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Mon, 27 Aug 2018 16:06:17 -0700 Subject: [PATCH] Add tests --- .../types/keyof/keyofAndIndexedAccess.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/cases/conformance/types/keyof/keyofAndIndexedAccess.ts b/tests/cases/conformance/types/keyof/keyofAndIndexedAccess.ts index c76071f7d99..7748240f80d 100644 --- a/tests/cases/conformance/types/keyof/keyofAndIndexedAccess.ts +++ b/tests/cases/conformance/types/keyof/keyofAndIndexedAccess.ts @@ -651,3 +651,17 @@ function ff2(dd: DictDict, k1: V, k2: const d: Dict = dd[k1]; return d[k2]; } + +// Repro from #26409 + +const cf1 = (t: T, k: K) => +{ + const s: string = t[k]; + t.cool; +}; + +const cf2 = (t: T, k: K) => +{ + const s: string = t[k]; + t.cool; +};