Revert apparently unnecessary addition

This commit is contained in:
Andrew Branch
2020-01-28 14:54:52 -08:00
parent 419dba1714
commit 7444b0b72e
2 changed files with 4 additions and 5 deletions

View File

@@ -2727,8 +2727,8 @@ namespace ts {
throw Debug.assertNever(name, "Unknown entity name kind.");
}
Debug.assert((getCheckFlags(symbol) & CheckFlags.Instantiated) === 0, "Should never get an instantiated symbol here.");
if (isIdentifier(name) && (symbol.flags & SymbolFlags.Alias || name.parent.kind === SyntaxKind.ExportAssignment)) {
markSymbolOfAliasDeclarationIfResolvesToTypeOnly(getAliasDeclarationFromName(name), symbol);
if (isIdentifier(name) && symbol.flags & SymbolFlags.Alias) {
markSymbolOfAliasDeclarationIfResolvesToTypeOnly(getTypeOnlyAliasDeclarationFromName(name), symbol);
}
return (symbol.flags & meaning) || dontResolveAlias ? symbol : resolveAlias(symbol);
}

View File

@@ -2766,14 +2766,13 @@ namespace ts {
node.kind === SyntaxKind.PropertyAssignment && isAliasableExpression((node as PropertyAssignment).initializer);
}
export function getAliasDeclarationFromName(node: Identifier): Declaration | undefined {
export function getTypeOnlyAliasDeclarationFromName(node: Identifier): TypeOnlyCompatibleAliasDeclaration | undefined {
switch (node.parent.kind) {
case SyntaxKind.ImportClause:
case SyntaxKind.ImportSpecifier:
case SyntaxKind.NamespaceImport:
case SyntaxKind.ExportSpecifier:
case SyntaxKind.ExportAssignment:
return node.parent as Declaration;
return node.parent as TypeOnlyCompatibleAliasDeclaration;
}
}