File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5665,19 +5665,19 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
56655665 if (getSymbolIfSameReference(exported, symbol)) {
56665666 return exported;
56675667 }
5668- if (symbol.flags & SymbolFlags.TypeAlias && exported.declarations?.find(isTypeAlias)) {
5669- const aliasSymbol = getDeclaredTypeOfTypeAlias(exported).aliasSymbol;
5670- if (aliasSymbol && getSymbolIfSameReference(aliasSymbol, symbol)) {
5671- return exported;
5672- }
5673- }
56745668 });
56755669 }
56765670
56775671 /**
56785672 * Checks if two symbols, through aliasing and/or merging, refer to the same thing
56795673 */
56805674 function getSymbolIfSameReference(s1: Symbol, s2: Symbol) {
5675+ if (s1.flags & SymbolFlags.TypeAlias && s2.declarations?.find(isTypeAlias)) {
5676+ s2 = getDeclaredTypeOfTypeAlias(s2).aliasSymbol || s2;
5677+ }
5678+ if (s2.flags & SymbolFlags.TypeAlias && s1.declarations?.find(isTypeAlias)) {
5679+ s1 = getDeclaredTypeOfTypeAlias(s1).aliasSymbol || s1;
5680+ }
56815681 if (getMergedSymbol(resolveSymbol(getMergedSymbol(s1))) === getMergedSymbol(resolveSymbol(getMergedSymbol(s2)))) {
56825682 return s1;
56835683 }
You can’t perform that action at this time.
0 commit comments