Skip to content

Commit

Permalink
Use direct VoidType definition on Return_ expr is null on ReturnedNod…
Browse files Browse the repository at this point in the history
…esReturnTypeInfererTypeInferer (#4752)
  • Loading branch information
samsonasik committed Aug 10, 2023
1 parent d32040f commit 9fcc5ba
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function inferFunctionLike(FunctionLike $functionLike): Type
foreach ($localReturnNodes as $localReturnNode) {
$returnedExprType = $localReturnNode->expr instanceof Expr
? $this->nodeTypeResolver->getNativeType($localReturnNode->expr)
: $this->nodeTypeResolver->getType($localReturnNode);
: new VoidType();
$returnedExprType = $this->correctWithNestedType($returnedExprType, $localReturnNode, $functionLike);

$types[] = $this->splArrayFixedTypeNarrower->narrow($returnedExprType);
Expand Down

0 comments on commit 9fcc5ba

Please sign in to comment.