-
-
Notifications
You must be signed in to change notification settings - Fork 946
Closed
Labels
Description
Bug report
The type \Closure(string)|\Closure(string, string) is collapsed to \Closure(string, string), with the assumption that \Closure(string) is covered by \Closure(string, string). This seems wrong, when considering optional parameters.
It's true that
$closure("Hello", "World");can be passed to \Closure(string) as extranous parameters are ignored by php. But considering \Closure(string, int=) the above doesn't hold and produce an error.
Code snippet that reproduces the problem
https://phpstan.org/r/f502c295-dde6-4647-9dd7-1f4bd1ba6219
Expected output
I would expect \Closure(string)|\Closure(string, string) to not be collapsed to \Closure(string, string)
Did PHPStan help you today? Did it make you happy in any way?
Of course it did
Reactions are currently unavailable