Merge pull request #15538 from Microsoft/isolated-modules_re-export-type

Don't allow to re-export a type when '--isolatedModules' is set
This commit is contained in:
Andy
2017-05-10 17:58:49 -07:00
committed by GitHub
5 changed files with 135 additions and 0 deletions

View File

@@ -21445,6 +21445,11 @@ namespace ts {
Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0;
error(node, message, symbolToString(symbol));
}
// 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)) {
error(node, Diagnostics.Cannot_re_export_a_type_when_the_isolatedModules_flag_is_provided);
}
}
}

View File

@@ -635,6 +635,10 @@
"category": "Error",
"code": 1203
},
"Cannot re-export a type when the '--isolatedModules' flag is provided.": {
"category": "Error",
"code": 1205
},
"Decorators are not valid here.": {
"category": "Error",
"code": 1206