-
Notifications
You must be signed in to change notification settings - Fork 548
Retain accessory string types in generics #1096
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
Retain accessory string types in generics #1096
Conversation
Seems to fix #6301. Inferring template types on intersection types is problematic because the bound type may not necessarily be a super type of all sub types of the passed intersection type
ondrejmirtes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise 👍
| require_once __DIR__ . '/../Rules/Generics/data/bug-3769.php'; | ||
| yield from $this->gatherAssertTypes(__DIR__ . '/../Rules/Generics/data/bug-3769.php'); | ||
|
|
||
| require_once __DIR__ . '/../Rules/Generics/data/bug-6301.php'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to require it. If it failed locally for you, you forgot to run composer dump before running the tests :)
|
Thank you! |
|
BTW @rvanvelzen Can you please send a regression test for phpstan/phpstan#3951 ? NodeScopeResolverTest case that checks the type of |
|
Sorry, correct link phpstan/phpstan#3951 |
|
Oh, there are even more: phpstan/phpstan#6845 and phpstan/phpstan#5336 |
|
Fyi, A regression test for phpstan/phpstan#5336 |
Seems to fix phpstan/phpstan#6301. Inferring template types on intersection types is problematic because the bound type may not necessarily be a super type of all sub types of the passed intersection type.