File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -27534,7 +27534,7 @@ namespace ts {
2753427534 const inferenceContext = getInferenceContext(node);
2753527535 // If no inferences have been made, nothing is gained from instantiating as type parameters
2753627536 // would just be replaced with their defaults similar to the apparent type.
27537- if (inferenceContext && contextFlags! & ContextFlags.Signature && some(inferenceContext.inferences, hasInferenceCandidates )) {
27537+ if (inferenceContext && contextFlags! & ContextFlags.Signature && some(inferenceContext.inferences, hasInferenceCandidatesOrDefault )) {
2753827538 // For contextual signatures we incorporate all inferences made so far, e.g. from return
2753927539 // types as well as arguments to the left in a function call.
2754027540 return instantiateInstantiableTypes(contextualType, inferenceContext.nonFixingMapper);
@@ -35145,6 +35145,10 @@ namespace ts {
3514535145 return !!(info.candidates || info.contraCandidates);
3514635146 }
3514735147
35148+ function hasInferenceCandidatesOrDefault(info: InferenceInfo) {
35149+ return !!(info.candidates || info.contraCandidates || hasTypeParameterDefault(info.typeParameter));
35150+ }
35151+
3514835152 function hasOverlappingInferences(a: InferenceInfo[], b: InferenceInfo[]) {
3514935153 for (let i = 0; i < a.length; i++) {
3515035154 if (hasInferenceCandidates(a[i]) && hasInferenceCandidates(b[i])) {
You can’t perform that action at this time.
0 commit comments