Fix error when exporting const enums (#33060) (#34721)

* Allow export declaration to reference const enums

* Update baselines

* Add test to verify reexported const enums are elided
This commit is contained in:
Evan Cahill
2019-10-25 16:04:44 -07:00
committed by Wesley Wigham
parent f12eee2e4b
commit 88f3593742
11 changed files with 224 additions and 241 deletions
+1 -1
View File
@@ -27465,7 +27465,7 @@ namespace ts {
(node.parent.kind === SyntaxKind.ElementAccessExpression && (<ElementAccessExpression>node.parent).expression === node) ||
((node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.QualifiedName) && isInRightSideOfImportOrExportAssignment(<Identifier>node) ||
(node.parent.kind === SyntaxKind.TypeQuery && (<TypeQueryNode>node.parent).exprName === node)) ||
(node.parent.kind === SyntaxKind.ExportSpecifier && (compilerOptions.preserveConstEnums || node.flags & NodeFlags.Ambient)); // We allow reexporting const enums
(node.parent.kind === SyntaxKind.ExportSpecifier); // We allow reexporting const enums
if (!ok) {
error(node, Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query);