Skip to content

Commit 81df7ec

Browse files
committed
Discard changes to src/Analyser/MutatingScope.php
1 parent a019d2b commit 81df7ec

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/Analyser/MutatingScope.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4485,9 +4485,8 @@ public function addTypeToExpression(Expr $expr, Type $type): self
44854485

44864486
if ($originalExprType->equals($nativeType)) {
44874487
$newType = TypeCombinator::intersect($type, $originalExprType);
4488-
if ($newType->isObject()->no() && $newType->equals($originalExprType)) {
4489-
// don't add the same type over and over again to improve performance.
4490-
// objects can get narrowed even though ObjectType->equal() will return true (e.g. via implicit "final" via new Foo())
4488+
if ($newType->isConstantScalarValue()->yes() && $newType->equals($originalExprType)) {
4489+
// don't add the same type over and over again to improve performance
44914490
return $this;
44924491
}
44934492
return $this->specifyExpressionType($expr, $newType, $newType, TrinaryLogic::createYes());

0 commit comments

Comments
 (0)