mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-11-18 20:11:14 +00:00
Use symbols of type aliases when emitting declarations (#56087)
This commit is contained in:
1 parent
4557e34e70
commit
4bcbc16cff
5 files changed
+172
No files matched your search
@@ -5719,6 +5719,12 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
* Checks if two symbols, through aliasing and/or merging, refer to the same thing
|
||||
*/
|
||||
function getSymbolIfSameReference(s1: Symbol, s2: Symbol) {
|
||||
if (s1.flags & SymbolFlags.TypeAlias && s2.declarations?.find(isTypeAlias)) {
|
||||
s2 = getDeclaredTypeOfTypeAlias(s2).aliasSymbol || s2;
|
||||
}
|
||||
if (s2.flags & SymbolFlags.TypeAlias && s1.declarations?.find(isTypeAlias)) {
|
||||
s1 = getDeclaredTypeOfTypeAlias(s1).aliasSymbol || s1;
|
||||
}
|
||||
if (getMergedSymbol(resolveSymbol(getMergedSymbol(s1))) === getMergedSymbol(resolveSymbol(getMergedSymbol(s2)))) {
|
||||
return s1;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user