Skip to content

Commit 2944a83

Browse files
committed
Discard changes to src/Analyser/MutatingScope.php
1 parent f478da8 commit 2944a83

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

44904490
if ($originalExprType->equals($nativeType)) {
44914491
$newType = TypeCombinator::intersect($type, $originalExprType);
4492-
if ($newType->isObject()->no() && $newType->equals($originalExprType)) {
4493-
// don't add the same type over and over again to improve performance.
4494-
// objects can get narrowed even though ObjectType->equal() will return true (e.g. via implicit "final" via new Foo())
4492+
if ($newType->isConstantScalarValue()->yes() && $newType->equals($originalExprType)) {
4493+
// don't add the same type over and over again to improve performance
44954494
return $this;
44964495
}
44974496
return $this->specifyExpressionType($expr, $newType, $newType, TrinaryLogic::createYes());

0 commit comments

Comments
 (0)