mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-04-17 01:49:41 -05:00
In getDeclarationSpaces, treat a type alias as a SymbolFlags.Type, not a SymbolFlags.Value (#16624)
This commit is contained in:
@@ -18860,6 +18860,7 @@ namespace ts {
|
||||
function getDeclarationSpaces(d: Declaration): SymbolFlags {
|
||||
switch (d.kind) {
|
||||
case SyntaxKind.InterfaceDeclaration:
|
||||
case SyntaxKind.TypeAliasDeclaration:
|
||||
return SymbolFlags.ExportType;
|
||||
case SyntaxKind.ModuleDeclaration:
|
||||
return isAmbientModule(d) || getModuleInstanceState(d) !== ModuleInstanceState.NonInstantiated
|
||||
@@ -18869,12 +18870,17 @@ namespace ts {
|
||||
case SyntaxKind.EnumDeclaration:
|
||||
return SymbolFlags.ExportType | SymbolFlags.ExportValue;
|
||||
case SyntaxKind.ImportEqualsDeclaration:
|
||||
let result: SymbolFlags = 0;
|
||||
let result = SymbolFlags.None;
|
||||
const target = resolveAlias(getSymbolOfNode(d));
|
||||
forEach(target.declarations, d => { result |= getDeclarationSpaces(d); });
|
||||
return result;
|
||||
default:
|
||||
case SyntaxKind.VariableDeclaration:
|
||||
case SyntaxKind.BindingElement:
|
||||
case SyntaxKind.FunctionDeclaration:
|
||||
case SyntaxKind.ImportSpecifier: // https://github.com/Microsoft/TypeScript/pull/7591
|
||||
return SymbolFlags.ExportValue;
|
||||
default:
|
||||
Debug.fail((ts as any).SyntaxKind[d.kind]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user