Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

array_map ignores union of callables #10442

Closed
mad-briller opened this issue Jan 15, 2024 · 2 comments · Fixed by phpstan/phpstan-src#2902
Closed

array_map ignores union of callables #10442

mad-briller opened this issue Jan 15, 2024 · 2 comments · Fixed by phpstan/phpstan-src#2902

Comments

@mad-briller
Copy link
Contributor

mad-briller commented Jan 15, 2024

Bug report

array_map ignores a union of callables and assumes only the first of the union will be used, leading to an incorrectly inferred return type.

This line appears to be where the issue originates from, as the dynamic return type extension is asking for the parameter acceptors from here.

Code snippet that reproduces the problem

https://phpstan.org/r/216eb0ae-bd17-4f8d-badd-466f7d2aee6e

Expected output

Expectations specified in playground with assertType

Did PHPStan help you today? Did it make you happy in any way?

As always!

@ondrejmirtes
Copy link
Member

Fixed: phpstan/phpstan-src#2902

Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants