Skip to content

Commit 084d14a

Browse files
committed
Fix logic error introduced in #30334
1 parent cabf72b commit 084d14a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/compiler/checker.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14617,9 +14617,11 @@ namespace ts {
1461714617
const candidate = propagationType || source;
1461814618
// We make contravariant inferences only if we are in a pure contravariant position,
1461914619
// i.e. only if we have not descended into a bivariant position.
14620-
if (contravariant && !bivariant && !contains(inference.contraCandidates, candidate)) {
14621-
inference.contraCandidates = append(inference.contraCandidates, candidate);
14622-
inference.inferredType = undefined;
14620+
if (contravariant && !bivariant) {
14621+
if (!contains(inference.contraCandidates, candidate)) {
14622+
inference.contraCandidates = append(inference.contraCandidates, candidate);
14623+
inference.inferredType = undefined;
14624+
}
1462314625
}
1462414626
else if (!contains(inference.candidates, candidate)) {
1462514627
inference.candidates = append(inference.candidates, candidate);

0 commit comments

Comments
 (0)