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