From 4e459e7a3e767dc7dbd5e228613db606ee6a7ecb Mon Sep 17 00:00:00 2001 From: Valentin Udaltsov Date: Thu, 21 Sep 2023 22:14:50 +0300 Subject: [PATCH] Fixed MethodReflection withResolvedTypes, toChildOf --- src/MethodReflection.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MethodReflection.php b/src/MethodReflection.php index 0a8d7e2..3ad4551 100644 --- a/src/MethodReflection.php +++ b/src/MethodReflection.php @@ -370,7 +370,7 @@ protected function withResolvedTypes(TypeVisitor $typeResolver): static static fn (ParameterReflection $parameter): ParameterReflection => $parameter->withResolvedTypes($typeResolver), $this->parameters, ); - $method->returnType->withResolvedTypes($typeResolver); + $method->returnType = $method->returnType->withResolvedTypes($typeResolver); return $method; } @@ -385,7 +385,7 @@ protected function toChildOf(FriendlyReflection $parent): static : $parameter, $this->parameters, ); - $method->returnType->toChildOf($parent->returnType); + $method->returnType = $method->returnType->toChildOf($parent->returnType); return $method; }