Skip to content

Commit ca9f599

Browse files
committed
Property access for string index signatures
1 parent 5c71de1 commit ca9f599

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/compiler/checker.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12223,6 +12223,10 @@ namespace ts {
1222312223
}
1222412224
const prop = getPropertyOfType(apparentType, right.text);
1222512225
if (!prop) {
12226+
const stringIndexType = getIndexTypeOfType(apparentType, IndexKind.String);
12227+
if (stringIndexType) {
12228+
return stringIndexType;
12229+
}
1222612230
if (right.text && !checkAndReportErrorForExtendingInterface(node)) {
1222712231
reportNonexistentProperty(right, type.flags & TypeFlags.TypeParameter && (type as TypeParameter).isThisType ? apparentType : type);
1222812232
}

0 commit comments

Comments
 (0)