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 41c2054 commit 663985eCopy full SHA for 663985e
src/compiler/checker.ts
@@ -5713,7 +5713,7 @@ namespace ts {
5713
5714
function getIndexType(type: Type): Type {
5715
return type.flags & TypeFlags.TypeParameter ? getIndexTypeForTypeParameter(<TypeParameter>type) :
5716
- getIndexInfoOfType(type, IndexKind.String) ? stringOrNumberType :
+ type.flags & TypeFlags.Any || getIndexInfoOfType(type, IndexKind.String) ? stringOrNumberType :
5717
getIndexInfoOfType(type, IndexKind.Number) ? getUnionType([numberType, getLiteralTypeFromPropertyNames(type)]) :
5718
getLiteralTypeFromPropertyNames(type);
5719
}
0 commit comments