--isolatedModules: Still allow re-export of type in a declaration file (#16399)

* --isolatedModules: Still allow re-export of type in a declaration file

* Use isInAmbientContext
This commit is contained in:
Andy
2017-06-09 09:39:55 -07:00
committed by GitHub
parent cae1286b72
commit a2d524252c
4 changed files with 35 additions and 2 deletions

View File

@@ -21789,7 +21789,10 @@ namespace ts {
}
// Don't allow to re-export something with no value side when `--isolatedModules` is set.
if (node.kind === SyntaxKind.ExportSpecifier && compilerOptions.isolatedModules && !(target.flags & SymbolFlags.Value)) {
if (compilerOptions.isolatedModules
&& node.kind === SyntaxKind.ExportSpecifier
&& !(target.flags & SymbolFlags.Value)
&& !isInAmbientContext(node)) {
error(node, Diagnostics.Cannot_re_export_a_type_when_the_isolatedModules_flag_is_provided);
}
}