Skip to content

Commit

Permalink
Revert more
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewbranch committed Feb 27, 2020
1 parent 81f6282 commit 0c7831d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
10 changes: 4 additions & 6 deletions src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2295,11 +2295,9 @@ namespace ts {
? Diagnostics._0_was_exported_here
: Diagnostics._0_was_imported_here;

// Non-null assertion is safe because `markSymbolOfAliasDeclarationIfTypeOnly` cannot return true
// for an ImportEqualsDeclaration without also being passed a defined symbol.
// `typeOnlyDeclaration.name` will be an Identifier for all valid cases, but may be undefined for
// invalid `export type * ...` syntax.
const name = unescapeLeadingUnderscores(tryCast(typeOnlyDeclaration.name, isIdentifier)?.escapedText ?? resolved!.escapedName);
// Non-null assertion is safe because the optionality comes from ImportClause,
// but if an ImportClause was the typeOnlyDeclaration, it had to have a `name`.
const name = unescapeLeadingUnderscores(typeOnlyDeclaration.name!.escapedText);
addRelatedInfo(error(node.moduleReference, message), createDiagnosticForNode(typeOnlyDeclaration, relatedMessage, name));
}
}
Expand Down Expand Up @@ -2730,7 +2728,7 @@ namespace ts {
}

/** Indicates that a symbol directly or indirectly resolves to a type-only import or export. */
function getTypeOnlyAliasDeclaration(symbol: Symbol): TypeOnlyCompatibleAliasDeclaration | NamespaceExport | ExportDeclaration | undefined {
function getTypeOnlyAliasDeclaration(symbol: Symbol): TypeOnlyCompatibleAliasDeclaration | undefined {
if (!(symbol.flags & SymbolFlags.Alias)) {
return undefined;
}
Expand Down
3 changes: 1 addition & 2 deletions src/compiler/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6216,8 +6216,7 @@ namespace ts {
}

export function typeOnlyDeclarationIsExport(typeOnlyDeclaration: Node) {
const kind = typeOnlyDeclaration.kind;
return kind === SyntaxKind.ExportSpecifier || kind === SyntaxKind.NamespaceExport || kind === SyntaxKind.ExportDeclaration;
return typeOnlyDeclaration.kind === SyntaxKind.ExportSpecifier;
}

function isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(node: Node) {
Expand Down

0 comments on commit 0c7831d

Please sign in to comment.