Skip to content

Detect closure parameter types when passing closure in a partially callable union#1019

Merged
ondrejmirtes merged 1 commit intophpstan:masterfrom
axlon:callable-in-union
Feb 25, 2022
Merged

Detect closure parameter types when passing closure in a partially callable union#1019
ondrejmirtes merged 1 commit intophpstan:masterfrom
axlon:callable-in-union

Conversation

@axlon
Copy link
Contributor

@axlon axlon commented Feb 14, 2022

Closes phpstan/phpstan#6629

Basically, drop all non-callable parts of a union when we pass a closure. If there is a better way to fix this let me know, happy to look into it.

@ondrejmirtes
Copy link
Member

Please rebase and fix the failures.

@axlon
Copy link
Contributor Author

axlon commented Feb 24, 2022

Done @ondrejmirtes! Some checks are still failing but from what I can tell these are unrelated to the PR

@ondrejmirtes ondrejmirtes merged commit a483c11 into phpstan:master Feb 25, 2022
@ondrejmirtes
Copy link
Member

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Callable parameter loses its argument typing when part of an union type

2 participants