mirror of
https://github.com/danog/psalm.git
synced 2025-01-23 06:11:25 +01:00
Prevent callable arg type enhancement for simple callable
This commit is contained in:
parent
d190b751fb
commit
0456ef82a5
@ -78,6 +78,10 @@ final class HighOrderFunctionArgHandler
|
||||
HighOrderFunctionArgInfo $high_order_callable_info,
|
||||
?TemplateResult $high_order_template_result
|
||||
): void {
|
||||
if ($high_order_callable_info->getType() === HighOrderFunctionArgInfo::TYPE_CALLABLE) {
|
||||
return;
|
||||
}
|
||||
|
||||
$statements_analyzer->node_data->setType($arg_expr, TemplateInferredTypeReplacer::replace(
|
||||
$high_order_callable_info->getFunctionType(),
|
||||
$high_order_template_result ?? new TemplateResult([], []),
|
||||
|
@ -54,6 +54,11 @@ final class HighOrderFunctionArgInfo
|
||||
return new TemplateResult($templates, []);
|
||||
}
|
||||
|
||||
public function getType(): string
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
public function getFunctionType(): Union
|
||||
{
|
||||
switch ($this->type) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user