@@ -2150,6 +2150,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
2150
2150
var silentNeverSignature = createSignature(/*declaration*/ undefined, /*typeParameters*/ undefined, /*thisParameter*/ undefined, emptyArray, silentNeverType, /*resolvedTypePredicate*/ undefined, 0, SignatureFlags.None);
2151
2151
2152
2152
var enumNumberIndexInfo = createIndexInfo(numberType, stringType, /*isReadonly*/ true);
2153
+ var anyBaseTypeIndexInfo = createIndexInfo(stringType, anyType, /*isReadonly*/ false);
2153
2154
2154
2155
var iterationTypesCache = new Map<string, IterationTypes>(); // cache for common IterationTypes instances
2155
2156
var noIterationTypes: IterationTypes = {
@@ -13385,7 +13386,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
13385
13386
addInheritedMembers(members, getPropertiesOfType(instantiatedBaseType));
13386
13387
callSignatures = concatenate(callSignatures, getSignaturesOfType(instantiatedBaseType, SignatureKind.Call));
13387
13388
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 ];
13389
13390
indexInfos = concatenate(indexInfos, filter(inheritedIndexInfos, info => !findIndexInfo(indexInfos, info.keyType)));
13390
13391
}
13391
13392
}
@@ -13917,7 +13918,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
13917
13918
addInheritedMembers(members, getPropertiesOfType(baseConstructorType));
13918
13919
}
13919
13920
else if (baseConstructorType === anyType) {
13920
- baseConstructorIndexInfo = createIndexInfo(stringType, anyType, /*isReadonly*/ false) ;
13921
+ baseConstructorIndexInfo = anyBaseTypeIndexInfo ;
13921
13922
}
13922
13923
}
13923
13924
@@ -50345,6 +50346,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
50345
50346
result ||= [];
50346
50347
for (const info of infoList!) {
50347
50348
if (info.declaration) continue;
50349
+ if (info === anyBaseTypeIndexInfo) continue; // inherited, but looks like a late-bound signature because it has no declarations
50348
50350
const node = nodeBuilder.indexInfoToIndexSignatureDeclaration(info, enclosing, flags, internalFlags, tracker);
50349
50351
if (node && infoList === staticInfos) {
50350
50352
(((node as Mutable<typeof node>).modifiers ||= factory.createNodeArray()) as MutableNodeArray<Modifier>).unshift(factory.createModifier(SyntaxKind.StaticKeyword));
0 commit comments