Recurse into generic objects parameters#306
Merged
ondrejmirtes merged 4 commits intophpstan:masterfrom Aug 30, 2020
pmmp:recurse-generic-objects
Merged
Recurse into generic objects parameters#306ondrejmirtes merged 4 commits intophpstan:masterfrom pmmp:recurse-generic-objects
ondrejmirtes merged 4 commits intophpstan:masterfrom
pmmp:recurse-generic-objects
Conversation
this breaks some iterable special-cases such as intersection of iterable<int>&Traversable. Needs to be investigated.
Member
|
Look at from which places are the Check classes called - these rules have unit tests. And I guess the |
I'm not sure this is right and gut feeling tells me it will cause some issues not to be reported, but let's see if this flies.
Contributor
Author
Do you want me to repeat the test cases 5 times (one for each of the places MissingTypehintCheck is used)? I hoped there was a better way :< |
Member
|
@dktapps It's fine to test it in a single rule. |
Member
|
Thank you! |
Contributor
Author
|
Thanks. Also, the original post referenced the wrong issue, I meant to link this one: phpstan/phpstan#3764 |
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
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.
This fixes phpstan/phpstan#3767: types like
GenericType<OtherGenericType>with invalid nested generic parameters not being analysed and reported.I'm aware that this breaks some iterable special-cases such as intersection of iterable&Traversable. I'm not entirely sure how to address this, so I could use some advice.
I also don't know if I missed any cases, although I don't think I did.
I'm also not sure how this should be tested. There doesn't seem to be any test unit dedicated to
MissingTypehintCheck.