mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Directly copy only the index signature in addition to declared properties (#56626)
This commit is contained in:
@@ -13060,12 +13060,11 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
const baseTypes = getBaseTypes(source);
|
||||
if (baseTypes.length) {
|
||||
if (source.symbol && members === getMembersOfSymbol(source.symbol)) {
|
||||
const symbolTable = createSymbolTable();
|
||||
// copy all symbols (except type parameters), including the ones with internal names like `InternalSymbolName.Index`
|
||||
for (const symbol of members.values()) {
|
||||
if (!(symbol.flags & SymbolFlags.TypeParameter)) {
|
||||
symbolTable.set(symbol.escapedName, symbol);
|
||||
}
|
||||
const symbolTable = createSymbolTable(source.declaredProperties);
|
||||
// copy index signature symbol as well (for quickinfo)
|
||||
const sourceIndex = getIndexSymbol(source.symbol);
|
||||
if (sourceIndex) {
|
||||
symbolTable.set(InternalSymbolName.Index, sourceIndex);
|
||||
}
|
||||
members = symbolTable;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user