Skip to content

Commit 0417592

Browse files
Include exported name in error message.
1 parent 109e0e2 commit 0417592

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15790,7 +15790,7 @@ namespace ts {
1579015790
const symbol = resolveName(exportedName, exportedName.text, SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace | SymbolFlags.Alias,
1579115791
/*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined);
1579215792
if (symbol && (symbol === undefinedSymbol || isGlobalSourceFile(getDeclarationContainer(symbol.declarations[0])))) {
15793-
error(exportedName, Diagnostics.Cannot_re_export_name_that_is_not_defined_in_the_module);
15793+
error(exportedName, Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module, exportedName.text);
1579415794
}
1579515795
else {
1579615796
markExportAsReferenced(node);

src/compiler/diagnosticMessages.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1819,7 +1819,7 @@
18191819
"category": "Error",
18201820
"code": 2660
18211821
},
1822-
"Cannot re-export name that is not defined in the module.": {
1822+
"Cannot export '{0}'. Only local declarations can be exported from a module.": {
18231823
"category": "Error",
18241824
"code": 2661
18251825
},

0 commit comments

Comments
 (0)