diff --git a/src/compiler/transformers/declarations.ts b/src/compiler/transformers/declarations.ts index 11a44ec3080..20aac7d4936 100644 --- a/src/compiler/transformers/declarations.ts +++ b/src/compiler/transformers/declarations.ts @@ -63,7 +63,7 @@ namespace ts { let enclosingDeclaration: Node; let necessaryTypeReferences: Map | undefined; let lateMarkedStatements: LateVisibilityPaintedStatement[] | undefined; - let lateStatementReplacementMap: Map>; + let lateStatementReplacementMap: Map>; let suppressNewDiagnosticContexts: boolean; let exportedModulesFromDeclarationEmit: Symbol[] | undefined; @@ -701,12 +701,12 @@ namespace ts { } } - function isExternalModuleIndicator(result: LateVisibilityPaintedStatement) { + function isExternalModuleIndicator(result: LateVisibilityPaintedStatement | ExportAssignment) { // Exported top-level member indicates moduleness return isAnyImportOrReExport(result) || isExportAssignment(result) || hasModifier(result, ModifierFlags.Export); } - function needsScopeMarker(result: LateVisibilityPaintedStatement) { + function needsScopeMarker(result: LateVisibilityPaintedStatement | ExportAssignment) { return !isAnyImportOrReExport(result) && !isExportAssignment(result) && !hasModifier(result, ModifierFlags.Export) && !isAmbientModule(result); } @@ -1228,8 +1228,6 @@ namespace ts { return preserveJsDoc(updateEnumMember(m, m.name, constValue !== undefined ? createLiteral(constValue) : undefined), m); })))); } - case SyntaxKind.ExportAssignment: - return; } // Anything left unhandled is an error, so this should be unreachable return Debug.assertNever(input, `Unhandled top-level node in declaration emit: ${(ts as any).SyntaxKind[(input as any).kind]}`); diff --git a/src/compiler/types.ts b/src/compiler/types.ts index a0b740236d3..088ae34ee34 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -3511,8 +3511,7 @@ namespace ts { | ModuleDeclaration | TypeAliasDeclaration | InterfaceDeclaration - | EnumDeclaration - | ExportAssignment; + | EnumDeclaration; /* @internal */ export interface SymbolVisibilityResult {