- 
  Notifications
 You must be signed in to change notification settings 
- Fork 545
ci: add failing test for bug-12585 #3828
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
 
  Open
 
 
 
 
  Open
 
 
 Conversation
 
 
 This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
 Learn more about bidirectional Unicode characters
 
 
 
 
 
 This was referenced Feb 16, 2025 
 
 
 
 
 
 makroxyz
 
 
 
 commented
 Feb 18, 2025 
 
 
 
Please merge!
@makroxyz It doesn't make sense to merge failing tests, it needs to be fixed first.
Looks similar to #3131
 @calebdw
 calebdw
 force-pushed
 the
 
 
 bug-12585
 
 branch
 from
 September 13, 2025 12:35  
 
30be1c6 to
 473eaa9  
 Compare
 
 
 
 Sign up for free
 to join this conversation on GitHub.
 Already have an account?
 Sign in to comment
 
 
 Add this suggestion to a batch that can be applied as a single commit.
 This suggestion is invalid because no changes were made to the code.
 Suggestions cannot be applied while the pull request is closed.
 Suggestions cannot be applied while viewing a subset of changes.
 Only one suggestion per line can be applied in a batch.
 Add this suggestion to a batch that can be applied as a single commit.
 Applying suggestions on deleted lines is not supported.
 You must change the existing code in this line in order to create a valid suggestion.
 Outdated suggestions cannot be applied.
 This suggestion has been applied or marked resolved.
 Suggestions cannot be applied from pending reviews.
 Suggestions cannot be applied on multi-line comments.
 Suggestions cannot be applied while the pull request is queued to merge.
 Suggestion cannot be applied right now. Please check back later.
 
 
 
 
Hello!
This adds failings tests for phpstan/phpstan#12585.
Please note that there's actually two bugs here:
1. Return type
I'm getting errors of the form:
despite the parent method having
(\Closure(Builder<TRelatedModel>): mixed)|nullas the$callbacktype; and theMethodParameterClosureTypeExtensionspecifyingMixedTypeas the return type for the replaced closure type.It seems like the parameter type of the closure phpdoc is being used as the return type...
2. Parameter Type
I am getting errors of the form:
I think that the
MethodParameterClosureTypeExtensionis only used to resolve the closure type inside the closure, while the PHPDoc is being used when checking method calls.Thanks!