@@ -2553,6 +2553,7 @@ function (MutatingScope $scope) use ($stmt, $expr, $nodeCallback, $context): Exp
2553
2553
$ scope = $ nameResult ->getScope ();
2554
2554
$ throwPoints = $ nameResult ->getThrowPoints ();
2555
2555
$ impurePoints = $ nameResult ->getImpurePoints ();
2556
+ $ isAlwaysTerminating = $ nameResult ->isAlwaysTerminating ();
2556
2557
if (
2557
2558
$ nameType ->isObject ()->yes ()
2558
2559
&& $ nameType ->isCallable ()->yes ()
@@ -2959,6 +2960,7 @@ static function (): void {
2959
2960
$ hasYield = $ classResult ->hasYield ();
2960
2961
$ throwPoints = array_merge ($ throwPoints , $ classResult ->getThrowPoints ());
2961
2962
$ impurePoints = array_merge ($ impurePoints , $ classResult ->getImpurePoints ());
2963
+ $ isAlwaysTerminating = $ classResult ->isAlwaysTerminating ();
2962
2964
foreach ($ additionalThrowPoints as $ throwPoint ) {
2963
2965
$ throwPoints [] = $ throwPoint ;
2964
2966
}
@@ -3106,14 +3108,14 @@ static function (): void {
3106
3108
$ hasYield = $ result ->hasYield ();
3107
3109
$ throwPoints = $ result ->getThrowPoints ();
3108
3110
$ impurePoints = $ result ->getImpurePoints ();
3109
- $ isAlwaysTerminating = false ;
3111
+ $ isAlwaysTerminating = $ result -> isAlwaysTerminating () ;
3110
3112
$ scope = $ result ->getScope ();
3111
3113
if ($ expr ->name instanceof Expr) {
3112
3114
$ result = $ this ->processExprNode ($ stmt , $ expr ->name , $ scope , $ nodeCallback , $ context ->enterDeep ());
3113
3115
$ hasYield = $ hasYield || $ result ->hasYield ();
3114
3116
$ throwPoints = array_merge ($ throwPoints , $ result ->getThrowPoints ());
3115
3117
$ impurePoints = array_merge ($ impurePoints , $ result ->getImpurePoints ());
3116
- $ isAlwaysTerminating = $ result ->isAlwaysTerminating ();
3118
+ $ isAlwaysTerminating = $ isAlwaysTerminating || $ result ->isAlwaysTerminating ();
3117
3119
$ scope = $ result ->getScope ();
3118
3120
if ($ this ->phpVersion ->supportsPropertyHooks ()) {
3119
3121
$ throwPoints [] = ThrowPoint::createImplicit ($ scope , $ expr );
0 commit comments