Fix logic error introduced in #30334
This commit is contained in:
parent
cabf72b514
commit
084d14a399
1 changed files with 5 additions and 3 deletions
|
@ -14617,10 +14617,12 @@ namespace ts {
|
|||
const candidate = propagationType || source;
|
||||
// We make contravariant inferences only if we are in a pure contravariant position,
|
||||
// i.e. only if we have not descended into a bivariant position.
|
||||
if (contravariant && !bivariant && !contains(inference.contraCandidates, candidate)) {
|
||||
if (contravariant && !bivariant) {
|
||||
if (!contains(inference.contraCandidates, candidate)) {
|
||||
inference.contraCandidates = append(inference.contraCandidates, candidate);
|
||||
inference.inferredType = undefined;
|
||||
}
|
||||
}
|
||||
else if (!contains(inference.candidates, candidate)) {
|
||||
inference.candidates = append(inference.candidates, candidate);
|
||||
inference.inferredType = undefined;
|
||||
|
|
Loading…
Reference in a new issue