MCPcopy Index your code
hub / github.com/nodejs/node / invocationErrorRecovery

Function invocationErrorRecovery

test/fixtures/snapshot/typescript.js:76764–76777  ·  view source on GitHub ↗
(apparentType, kind, diagnostic)

Source from the content-addressed store, hash-verified

76762 invocationErrorRecovery(apparentType, kind, relatedInformation ? ts.addRelatedInfo(diagnostic, relatedInformation) : diagnostic);
76763 }
76764 function invocationErrorRecovery(apparentType, kind, diagnostic) {
76765 if (!apparentType.symbol) {
76766 return;
76767 }
76768 var importNode = getSymbolLinks(apparentType.symbol).originatingImport;
76769 // Create a diagnostic on the originating import if possible onto which we can attach a quickfix
76770 // An import call expression cannot be rewritten into another form to correct the error - the only solution is to use `.default` at the use-site
76771 if (importNode && !ts.isImportCall(importNode)) {
76772 var sigs = getSignaturesOfType(getTypeOfSymbol(getSymbolLinks(apparentType.symbol).target), kind);
76773 if (!sigs || !sigs.length)
76774 return;
76775 ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(importNode, ts.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));
76776 }
76777 }
76778 function resolveTaggedTemplateExpression(node, candidatesOutArray, checkMode) {
76779 var tagType = checkExpression(node.tag);
76780 var apparentType = getApparentType(tagType);

Callers 2

invocationErrorFunction · 0.85
resolveDecoratorFunction · 0.85

Calls 3

getSymbolLinksFunction · 0.85
getSignaturesOfTypeFunction · 0.85
getTypeOfSymbolFunction · 0.85

Tested by

no test coverage detected