@@ -2150,6 +2150,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
21502150 var silentNeverSignature = createSignature(/*declaration*/ undefined, /*typeParameters*/ undefined, /*thisParameter*/ undefined, emptyArray, silentNeverType, /*resolvedTypePredicate*/ undefined, 0, SignatureFlags.None);
21512151
21522152 var enumNumberIndexInfo = createIndexInfo(numberType, stringType, /*isReadonly*/ true);
2153+ var anyBaseTypeIndexInfo = createIndexInfo(stringType, anyType, /*isReadonly*/ false);
21532154
21542155 var iterationTypesCache = new Map<string, IterationTypes>(); // cache for common IterationTypes instances
21552156 var noIterationTypes: IterationTypes = {
@@ -13385,7 +13386,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
1338513386 addInheritedMembers(members, getPropertiesOfType(instantiatedBaseType));
1338613387 callSignatures = concatenate(callSignatures, getSignaturesOfType(instantiatedBaseType, SignatureKind.Call));
1338713388 constructSignatures = concatenate(constructSignatures, getSignaturesOfType(instantiatedBaseType, SignatureKind.Construct));
13388- const inheritedIndexInfos = instantiatedBaseType !== anyType ? getIndexInfosOfType(instantiatedBaseType) : [createIndexInfo(stringType, anyType, /*isReadonly*/ false) ];
13389+ const inheritedIndexInfos = instantiatedBaseType !== anyType ? getIndexInfosOfType(instantiatedBaseType) : [anyBaseTypeIndexInfo ];
1338913390 indexInfos = concatenate(indexInfos, filter(inheritedIndexInfos, info => !findIndexInfo(indexInfos, info.keyType)));
1339013391 }
1339113392 }
@@ -13917,7 +13918,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
1391713918 addInheritedMembers(members, getPropertiesOfType(baseConstructorType));
1391813919 }
1391913920 else if (baseConstructorType === anyType) {
13920- baseConstructorIndexInfo = createIndexInfo(stringType, anyType, /*isReadonly*/ false) ;
13921+ baseConstructorIndexInfo = anyBaseTypeIndexInfo ;
1392113922 }
1392213923 }
1392313924
@@ -50345,6 +50346,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
5034550346 result ||= [];
5034650347 for (const info of infoList!) {
5034750348 if (info.declaration) continue;
50349+ if (info === anyBaseTypeIndexInfo) continue; // inherited, but looks like a late-bound signature because it has no declarations
5034850350 const node = nodeBuilder.indexInfoToIndexSignatureDeclaration(info, enclosing, flags, internalFlags, tracker);
5034950351 if (node && infoList === staticInfos) {
5035050352 (((node as Mutable<typeof node>).modifiers ||= factory.createNodeArray()) as MutableNodeArray<Modifier>).unshift(factory.createModifier(SyntaxKind.StaticKeyword));
0 commit comments