From ca9f599563e6f089d34284efbf01ef46040ad7d8 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Mon, 5 Dec 2016 09:57:11 -0800 Subject: [PATCH] Property access for string index signatures --- src/compiler/checker.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 903c8cfda1c..4a575e014cd 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -12223,6 +12223,10 @@ namespace ts { } const prop = getPropertyOfType(apparentType, right.text); if (!prop) { + const stringIndexType = getIndexTypeOfType(apparentType, IndexKind.String); + if (stringIndexType) { + return stringIndexType; + } if (right.text && !checkAndReportErrorForExtendingInterface(node)) { reportNonexistentProperty(right, type.flags & TypeFlags.TypeParameter && (type as TypeParameter).isThisType ? apparentType : type); }