diff --git a/src/Analyser/ExpressionTypeHolder.php b/src/Analyser/ExpressionTypeHolder.php index c904db8d7d..1be893b4bd 100644 --- a/src/Analyser/ExpressionTypeHolder.php +++ b/src/Analyser/ExpressionTypeHolder.php @@ -39,7 +39,7 @@ public function equals(self $other): bool public function and(self $other): self { - if ($this->type->equals($other->type)) { + if ($this->type === $other->type || $this->type->equals($other->type)) { if ($this->certainty->equals($other->certainty)) { return $this; }