File tree 1 file changed +2
-3
lines changed
1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -25165,10 +25165,9 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
25165
25165
// and has inferences that would conflict. Otherwise, we prefer the contra-variant inference.
25166
25166
const preferCovariantType = inferredCovariantType && (!inferredContravariantType ||
25167
25167
!(inferredCovariantType.flags & TypeFlags.Never) &&
25168
- every(inference.candidates, t => isTypeSubtypeOf(t, inferredCovariantType)) &&
25169
25168
some(inference.contraCandidates, t => isTypeSubtypeOf(inferredCovariantType, t)) &&
25170
- every(context.inferences, other => other === inference ||
25171
- getConstraintOfTypeParameter(other.typeParameter) !== inference.typeParameter ||
25169
+ every(context.inferences, other =>
25170
+ other !== inference && getConstraintOfTypeParameter(other.typeParameter) !== inference.typeParameter ||
25172
25171
every(other.candidates, t => isTypeSubtypeOf(t, inferredCovariantType))));
25173
25172
inferredType = preferCovariantType ? inferredCovariantType : inferredContravariantType;
25174
25173
fallbackType = preferCovariantType ? inferredContravariantType : inferredCovariantType;
You can’t perform that action at this time.
0 commit comments