diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 8fe87324a0afe..2acdf10af1b43 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -19102,8 +19102,10 @@ namespace ts { if (importNode && !isImportCall(importNode)) { const sigs = getSignaturesOfType(getTypeOfSymbol(getSymbolLinks(apparentType.symbol).target!), kind); if (!sigs || !sigs.length) return; - Debug.assert(!diagnostic.relatedInformation); - diagnostic.relatedInformation = [createDiagnosticForNode(importNode, Diagnostics.Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead)]; + + addRelatedInfo(diagnostic, + createDiagnosticForNode(importNode, Diagnostics.Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead) + ); } }