mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
Fix logic error introduced in #30334
This commit is contained in:
@@ -14617,9 +14617,11 @@ 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)) {
|
||||
inference.contraCandidates = append(inference.contraCandidates, candidate);
|
||||
inference.inferredType = undefined;
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user