Skip to content

Commit 11aa1b9

Browse files
committed
Discard changes to src/Analyser/MutatingScope.php
1 parent 681d912 commit 11aa1b9

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
@@ -4486,9 +4486,8 @@ public function addTypeToExpression(Expr $expr, Type $type): self
44864486

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

0 commit comments

Comments
 (0)