Skip to content

Commit

Permalink
fixed mutating types (#546)
Browse files Browse the repository at this point in the history
  • Loading branch information
romalytvynenko authored Sep 16, 2024
1 parent 4752b98 commit cca33ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Infer/Services/ReferenceTypeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public function resolve(Scope $scope, Type $type): Type
onInfiniteRecursion: fn () => new UnknownType('really bad self reference'),
);

return RecursionGuard::run(
return deep_copy(RecursionGuard::run(
$resultingType,//->toString(),
fn () => (new TypeWalker)->replace(
$resultingType,
Expand All @@ -128,7 +128,7 @@ public function resolve(Scope $scope, Type $type): Type
: null,
),
onInfiniteRecursion: fn () => new UnknownType('really bad self reference'),
);
));
}

private function checkDependencies(AbstractReferenceType $type)
Expand Down

0 comments on commit cca33ec

Please sign in to comment.