Skip to content

Commit 23553bb

Browse files
committed
getWithAlternativeContainers for all containers
1 parent 5ef3a8e commit 23553bb

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/compiler/checker.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5626,7 +5626,17 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
56265626
return undefined;
56275627
}
56285628
const containers = mapDefined(candidates, candidate => getAliasForSymbolInContainer(candidate, symbol) ? candidate : undefined);
5629-
return containers.length === 1 ? getWithAlternativeContainers(containers[0]) : containers;
5629+
5630+
let bestContainers: Symbol[] = [];
5631+
let alternativeContainers: Symbol[] = [];
5632+
5633+
for (const container of containers) {
5634+
const [bestMatch, ...rest] = getWithAlternativeContainers(container);
5635+
bestContainers = append(bestContainers, bestMatch);
5636+
alternativeContainers = addRange(alternativeContainers, rest);
5637+
}
5638+
5639+
return concatenate(bestContainers, alternativeContainers);
56305640

56315641
function getWithAlternativeContainers(container: Symbol) {
56325642
const additionalContainers = mapDefined(container.declarations, fileSymbolIfFileSymbolExportEqualsContainer);

0 commit comments

Comments
 (0)