@@ -2151,6 +2151,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
21512151 var silentNeverSignature = createSignature(/*declaration*/ undefined, /*typeParameters*/ undefined, /*thisParameter*/ undefined, emptyArray, silentNeverType, /*resolvedTypePredicate*/ undefined, 0, SignatureFlags.None);
21522152
21532153 var enumNumberIndexInfo = createIndexInfo(numberType, stringType, /*isReadonly*/ true);
2154+ var anyBaseTypeIndexInfo = createIndexInfo(stringType, anyType, /*isReadonly*/ false);
21542155
21552156 var iterationTypesCache = new Map<string, IterationTypes>(); // cache for common IterationTypes instances
21562157 var noIterationTypes: IterationTypes = {
@@ -13454,7 +13455,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
1345413455 addInheritedMembers(members, getPropertiesOfType(instantiatedBaseType));
1345513456 callSignatures = concatenate(callSignatures, getSignaturesOfType(instantiatedBaseType, SignatureKind.Call));
1345613457 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 ];
1345813459 indexInfos = concatenate(indexInfos, filter(inheritedIndexInfos, info => !findIndexInfo(indexInfos, info.keyType)));
1345913460 }
1346013461 }
@@ -13986,7 +13987,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
1398613987 addInheritedMembers(members, getPropertiesOfType(baseConstructorType));
1398713988 }
1398813989 else if (baseConstructorType === anyType) {
13989- baseConstructorIndexInfo = createIndexInfo(stringType, anyType, /*isReadonly*/ false) ;
13990+ baseConstructorIndexInfo = anyBaseTypeIndexInfo ;
1399013991 }
1399113992 }
1399213993
@@ -50781,6 +50782,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
5078150782 result ||= [];
5078250783 for (const info of infoList!) {
5078350784 if (info.declaration) continue;
50785+ if (info === anyBaseTypeIndexInfo) continue; // inherited, but looks like a late-bound signature because it has no declarations
5078450786 const node = nodeBuilder.indexInfoToIndexSignatureDeclaration(info, enclosing, flags, internalFlags, tracker);
5078550787 if (node && infoList === staticInfos) {
5078650788 (((node as Mutable<typeof node>).modifiers ||= factory.createNodeArray()) as MutableNodeArray<Modifier>).unshift(factory.createModifier(SyntaxKind.StaticKeyword));
0 commit comments