Fix crash when trying to import a non-exported type (#36619)

* Fix crash when trying to import a non-exported type

* Add related info on each declaration
This commit is contained in:
Andrew Branch
2020-02-05 08:27:49 -08:00
committed by GitHub
parent 09441107c1
commit 20471182fc
11 changed files with 122 additions and 2 deletions

View File

@@ -2530,8 +2530,8 @@ namespace ts {
: error(name, Diagnostics.Module_0_declares_1_locally_but_it_is_not_exported, moduleName, declarationName);
addRelatedInfo(diagnostic,
createDiagnosticForNode(localSymbol.valueDeclaration, Diagnostics._0_is_declared_here, declarationName)
);
...map(localSymbol.declarations, (decl, index) =>
createDiagnosticForNode(decl, index === 0 ? Diagnostics._0_is_declared_here : Diagnostics.and_here, declarationName)));
}
else {
error(name, Diagnostics.Module_0_has_no_exported_member_1, moduleName, declarationName);