-
Notifications
You must be signed in to change notification settings - Fork 426
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
Fix inferring template types on intersection types #1122
Fix inferring template types on intersection types #1122
Conversation
as I noticed by coincidence - it doesn't need to be part of/fixed by this PR, but maybe its a related issue: phpstan/phpstan#5592 (comment) just want to make you aware |
Thanks for your quick reaction |
b3fa91b
to
5feb496
Compare
c877ec1 was incorrect in hindsight. I'm not really happy about this solution. The problem is that types like non-empty-string are represented by an intersection of string&non-empty-string, and when the inference is looking at these types it gets confused because non-empty-string on its own doesn't make much sense. Closes phpstan/phpstan#6904 and phpstan/phpstan#6917
1e02708
to
247279f
Compare
The failures in CI are in Rector and Composer:
|
Can you please check what's going on in these errors and whether they are legit or whether they should be fixed in this PR? Feel free to reproduce them in phpstan-src test suite. |
The composer failure seems legit to me: https://phpstan.org/r/33fa6126-1af3-49b2-b505-922f22367f11 |
Thank you, awesome 😊 |
I was just about to say that the Rector one is a regression. Will send a PR once I've got a solution |
It's fine, I'm not releasing it right away 😊 Thank you. |
Perhaps I was wrong. This seems to be the Rector case: https://phpstan.org/r/ca5584c3-6a43-4046-b1d2-b7514b9e699a Before So if you agree I'll leave this as-is, and we'll hear about actual regressions when this is released. |
Alright, I'm gonna tag 1.5.1 :) |
c877ec1 was incorrect in hindsight
Closes phpstan/phpstan#6904 and phpstan/phpstan#6917