@@ -13635,12 +13635,6 @@ namespace ts {
13635
13635
return result;
13636
13636
}
13637
13637
13638
- if (isJsxOpeningOrSelfClosingElement) {
13639
- // If there is not result, just return the last one we try as a candidate.
13640
- // We do not report any error here because any error will be handled in "resolveCustomJsxElementAttributesType".
13641
- return candidateForArgumentError;
13642
- }
13643
-
13644
13638
// No signatures were applicable. Now report errors based on the last applicable signature with
13645
13639
// no arguments excluded from assignability checks.
13646
13640
// If candidate is undefined, it means that no candidates had a suitable arity. In that case,
@@ -13651,6 +13645,11 @@ namespace ts {
13651
13645
// in arguments too early. If possible, we'd like to only type them once we know the correct
13652
13646
// overload. However, this matters for the case where the call is correct. When the call is
13653
13647
// an error, we don't need to exclude any arguments, although it would cause no harm to do so.
13648
+ if (isJsxOpeningOrSelfClosingElement) {
13649
+ // If there is not result, just return the last one we try as a candidate.
13650
+ // We do not report any error here because any error will be handled in "resolveCustomJsxElementAttributesType".
13651
+ return candidateForArgumentError;
13652
+ }
13654
13653
checkApplicableSignature(node, args, candidateForArgumentError, assignableRelation, /*excludeArgument*/ undefined, /*reportErrors*/ true);
13655
13654
}
13656
13655
else if (candidateForTypeArgumentError) {
@@ -13671,7 +13670,7 @@ namespace ts {
13671
13670
diagnosticChainHead = chainDiagnosticMessages(diagnosticChainHead, headMessage);
13672
13671
}
13673
13672
13674
- reportNoCommonSupertypeError(inferenceCandidates, (<CallExpression>node).expression || (<TaggedTemplateExpression>node).tag, diagnosticChainHead);
13673
+ reportNoCommonSupertypeError(inferenceCandidates, (<JsxOpeningLikeElement>node).tagName || (< CallExpression>node).expression || (<TaggedTemplateExpression>node).tag, diagnosticChainHead);
13675
13674
}
13676
13675
}
13677
13676
else {
@@ -14072,10 +14071,6 @@ namespace ts {
14072
14071
links.resolvedSignature = resolvingSignature;
14073
14072
14074
14073
let callSignature = resolveStatelessJsxOpeningLikeElement(openingLikeElement, elementType, candidatesOutArray);
14075
- if (!callSignature || callSignature === unknownSignature) {
14076
- const callSignatures = elementType && getSignaturesOfType(elementType, SignatureKind.Call);
14077
- callSignature = callSignatures[callSignatures.length - 1];
14078
- }
14079
14074
links.resolvedSignature = callSignature;
14080
14075
// If signature resolution originated in control flow type analysis (for example to compute the
14081
14076
// assigned type in a flow assignment) we don't cache the result as it may be based on temporary
0 commit comments