File tree 1 file changed +14
-0
lines changed
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -14894,6 +14894,20 @@ namespace ts {
14894
14894
// Type parameters from outer context referenced by source type are fixed by instantiation of the source type
14895
14895
inferTypes(context.inferences, instantiateType(source, contextualMapper), target);
14896
14896
});
14897
+ // If contextualMapper is fakeInferenceMapper we are being called by checkApplicableSignature.
14898
+ if (contextualMapper === fakeInferenceMapper) {
14899
+ let source, target;
14900
+ if (contextualSignature.typePredicate && signature.typePredicate && contextualSignature.typePredicate.kind === signature.typePredicate.kind) {
14901
+ source = contextualSignature.typePredicate.type;
14902
+ target = signature.typePredicate.type;
14903
+ }
14904
+ else {
14905
+ source = getReturnTypeOfSignature(contextualSignature);
14906
+ target = getReturnTypeOfSignature(signature);
14907
+ }
14908
+ // source is already instantiated by the caller of fakeInferenceMapper.
14909
+ inferTypes(context.inferences, source, target);
14910
+ }
14897
14911
const inferred = getInferredTypes(context);
14898
14912
for (let i = 0; i < inferred.length; ++i) {
14899
14913
// If inference has failed, use the first constituent type. During checking, the other
You can’t perform that action at this time.
0 commit comments