diff --git a/src/Analyser/MutatingScope.php b/src/Analyser/MutatingScope.php index 589fd947d..135a0deae 100644 --- a/src/Analyser/MutatingScope.php +++ b/src/Analyser/MutatingScope.php @@ -1716,7 +1716,7 @@ static function (Node $node, Scope $scope) use ($arrowScope, &$arrowFunctionImpu return new MixedType(); } - $returnType = ParametersAcceptorSelector::selectSingle($functionReflection->getVariants())->getReturnType(); + $returnType = $functionReflection->getReturnType(); $generatorSendType = $returnType->getTemplateType(Generator::class, 'TSend'); if ($generatorSendType instanceof ErrorType) { return new MixedType(); @@ -3134,17 +3134,16 @@ private function enterFunctionLike( bool $preserveThis, ): self { - $acceptor = ParametersAcceptorSelector::selectSingle($functionReflection->getVariants()); $parametersByName = []; - foreach ($acceptor->getParameters() as $parameter) { + foreach ($functionReflection->getParameters() as $parameter) { $parametersByName[$parameter->getName()] = $parameter; } $expressionTypes = []; $nativeExpressionTypes = []; $conditionalTypes = []; - foreach ($acceptor->getParameters() as $parameter) { + foreach ($functionReflection->getParameters() as $parameter) { $parameterType = $parameter->getType(); if ($parameterType instanceof ConditionalTypeForParameter) {