@@ -2554,7 +2554,6 @@ function (MutatingScope $scope) use ($stmt, $expr, $nodeCallback, $context): Exp
25542554 $ scope = $ nameResult ->getScope ();
25552555 $ throwPoints = $ nameResult ->getThrowPoints ();
25562556 $ impurePoints = $ nameResult ->getImpurePoints ();
2557- $ isAlwaysTerminating = $ nameResult ->isAlwaysTerminating ();
25582557 if (
25592558 $ nameType ->isObject ()->yes ()
25602559 && $ nameType ->isCallable ()->yes ()
@@ -2570,7 +2569,7 @@ static function (): void {
25702569 );
25712570 $ throwPoints = array_merge ($ throwPoints , $ invokeResult ->getThrowPoints ());
25722571 $ impurePoints = array_merge ($ impurePoints , $ invokeResult ->getImpurePoints ());
2573- $ isAlwaysTerminating = $ isAlwaysTerminating || $ invokeResult ->isAlwaysTerminating ();
2572+ $ isAlwaysTerminating = $ invokeResult ->isAlwaysTerminating ();
25742573 } elseif ($ parametersAcceptor instanceof CallableParametersAcceptor) {
25752574 $ callableThrowPoints = array_map (static fn (SimpleThrowPoint $ throwPoint ) => $ throwPoint ->isExplicit () ? ThrowPoint::createExplicit ($ scope , $ throwPoint ->getType (), $ expr , $ throwPoint ->canContainAnyThrowable ()) : ThrowPoint::createImplicit ($ scope , $ expr ), $ parametersAcceptor ->getThrowPoints ());
25762575 if (!$ this ->implicitThrows ) {
@@ -2818,6 +2817,7 @@ static function (): void {
28182817 $ hasYield = $ result ->hasYield ();
28192818 $ throwPoints = $ result ->getThrowPoints ();
28202819 $ impurePoints = $ result ->getImpurePoints ();
2820+ $ isAlwaysTerminating = $ result ->isAlwaysTerminating ();
28212821 $ scope = $ result ->getScope ();
28222822 if (isset ($ closureCallScope )) {
28232823 $ scope = $ scope ->restoreOriginalScopeAfterClosureBind ($ originalScope );
@@ -2924,6 +2924,7 @@ static function (): void {
29242924 $ hasYield = $ hasYield || $ result ->hasYield ();
29252925 $ throwPoints = array_merge ($ throwPoints , $ result ->getThrowPoints ());
29262926 $ impurePoints = array_merge ($ impurePoints , $ result ->getImpurePoints ());
2927+ $ isAlwaysTerminating = $ isAlwaysTerminating || $ result ->isAlwaysTerminating ();
29272928 } elseif ($ expr instanceof Expr \NullsafeMethodCall) {
29282929 $ nonNullabilityResult = $ this ->ensureShallowNonNullability ($ scope , $ scope , $ expr ->var );
29292930 $ exprResult = $ this ->processExprNode ($ stmt , new MethodCall ($ expr ->var , $ expr ->name , $ expr ->args , array_merge ($ expr ->getAttributes (), ['virtualNullsafeMethodCall ' => true ])), $ nonNullabilityResult ->getScope (), $ nodeCallback , $ context );
@@ -3097,6 +3098,7 @@ static function (): void {
30973098 $ hasYield = $ hasYield || $ result ->hasYield ();
30983099 $ throwPoints = array_merge ($ throwPoints , $ result ->getThrowPoints ());
30993100 $ impurePoints = array_merge ($ impurePoints , $ result ->getImpurePoints ());
3101+ $ isAlwaysTerminating = $ isAlwaysTerminating || $ result ->isAlwaysTerminating ();
31003102 } elseif ($ expr instanceof PropertyFetch) {
31013103 $ scopeBeforeVar = $ scope ;
31023104 $ result = $ this ->processExprNode ($ stmt , $ expr ->var , $ scope , $ nodeCallback , $ context ->enterDeep ());
0 commit comments