@@ -2151,6 +2151,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
2151
2151
var silentNeverSignature = createSignature(/*declaration*/ undefined, /*typeParameters*/ undefined, /*thisParameter*/ undefined, emptyArray, silentNeverType, /*resolvedTypePredicate*/ undefined, 0, SignatureFlags.None);
2152
2152
2153
2153
var enumNumberIndexInfo = createIndexInfo(numberType, stringType, /*isReadonly*/ true);
2154
+ var anyBaseTypeIndexInfo = createIndexInfo(stringType, anyType, /*isReadonly*/ false);
2154
2155
2155
2156
var iterationTypesCache = new Map<string, IterationTypes>(); // cache for common IterationTypes instances
2156
2157
var noIterationTypes: IterationTypes = {
@@ -13454,7 +13455,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
13454
13455
addInheritedMembers(members, getPropertiesOfType(instantiatedBaseType));
13455
13456
callSignatures = concatenate(callSignatures, getSignaturesOfType(instantiatedBaseType, SignatureKind.Call));
13456
13457
constructSignatures = concatenate(constructSignatures, getSignaturesOfType(instantiatedBaseType, SignatureKind.Construct));
13457
- const inheritedIndexInfos = instantiatedBaseType !== anyType ? getIndexInfosOfType(instantiatedBaseType) : [createIndexInfo(stringType, anyType, /*isReadonly*/ false) ];
13458
+ const inheritedIndexInfos = instantiatedBaseType !== anyType ? getIndexInfosOfType(instantiatedBaseType) : [anyBaseTypeIndexInfo ];
13458
13459
indexInfos = concatenate(indexInfos, filter(inheritedIndexInfos, info => !findIndexInfo(indexInfos, info.keyType)));
13459
13460
}
13460
13461
}
@@ -13986,7 +13987,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
13986
13987
addInheritedMembers(members, getPropertiesOfType(baseConstructorType));
13987
13988
}
13988
13989
else if (baseConstructorType === anyType) {
13989
- baseConstructorIndexInfo = createIndexInfo(stringType, anyType, /*isReadonly*/ false) ;
13990
+ baseConstructorIndexInfo = anyBaseTypeIndexInfo ;
13990
13991
}
13991
13992
}
13992
13993
@@ -50781,6 +50782,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
50781
50782
result ||= [];
50782
50783
for (const info of infoList!) {
50783
50784
if (info.declaration) continue;
50785
+ if (info === anyBaseTypeIndexInfo) continue; // inherited, but looks like a late-bound signature because it has no declarations
50784
50786
const node = nodeBuilder.indexInfoToIndexSignatureDeclaration(info, enclosing, flags, internalFlags, tracker);
50785
50787
if (node && infoList === staticInfos) {
50786
50788
(((node as Mutable<typeof node>).modifiers ||= factory.createNodeArray()) as MutableNodeArray<Modifier>).unshift(factory.createModifier(SyntaxKind.StaticKeyword));
0 commit comments