Closed
Description
Bug report
Currently
@return \Closure(int ...$u, string): string
phpdoc works correctly, but
@return \Closure(...int, object): string
is silently ignored. No wrong phpdoc error, no error when this type does not match the type of the returned value.
Even if such type is not documented as supported - https://phpstan.org/writing-php-code/phpdoc-types#callables - I belive it should be supported as standard (non-vargs) unnamed parameters are supported.
Code snippet that reproduces the problem
https://phpstan.org/r/f3779e03-f24f-43e7-8d73-b27973bbd15c
Expected output
The 2nd phpdoc must emit a phpstan error, the type (return type of the Closure
) does not match the result.
Metadata
Metadata
Assignees
Labels
No labels