Skip to content

Commit c87f1cb

Browse files
committed
Fix regression
1 parent 172a9e2 commit c87f1cb

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/Analyser/MutatingScope.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,6 +1081,15 @@ private function resolveType(string $exprString, Expr $node): Type
10811081
}
10821082
}
10831083

1084+
if (
1085+
!$node instanceof Variable
1086+
&& !$node instanceof Expr\Closure
1087+
&& !$node instanceof Expr\ArrowFunction
1088+
&& $this->hasExpressionType($node)->yes()
1089+
) {
1090+
return $this->expressionTypes[$exprString]->getType();
1091+
}
1092+
10841093
/** @var ExprHandler<Expr> $exprHandler */
10851094
foreach ($this->container->getServicesByTag(ExprHandler::EXTENSION_TAG) as $exprHandler) {
10861095
if (!$exprHandler->supports($node)) {
@@ -1094,15 +1103,6 @@ private function resolveType(string $exprString, Expr $node): Type
10941103
return $exprHandler->resolveType($this, $node);
10951104
}
10961105

1097-
if (
1098-
!$node instanceof Variable
1099-
&& !$node instanceof Expr\Closure
1100-
&& !$node instanceof Expr\ArrowFunction
1101-
&& $this->hasExpressionType($node)->yes()
1102-
) {
1103-
return $this->expressionTypes[$exprString]->getType();
1104-
}
1105-
11061106
if ($node instanceof AlwaysRememberedExpr) {
11071107
return $this->nativeTypesPromoted ? $node->getNativeExprType() : $node->getExprType();
11081108
}

0 commit comments

Comments
 (0)