-
Notifications
You must be signed in to change notification settings - Fork 483
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
Don't generalize template types #1206
base: 1.9.x
Are you sure you want to change the base?
Conversation
Yeah but the same argument can be used to keep the current behaviour :) BTW Can you please tell me which items from phpstan/phpstan#3853 (comment) do you plan to work on? Once I finish the memory optimization I'm working on right now, the only thing before releasing 1.6.0 is the finished support for conditional return types, so I'd like to get that over the finish line too :) Thanks. |
Definitely. Just throwing this out there :)
Sure. I'm planning on working on these today:
I'm not sure how soon I'll get to any of the rest. I do realize that that doesn't help much, but I'd rather not make false promises. |
Yeah, this is totally fine, I can take over some of the work myself, just wanted to make sure we're synchronized (I'll let you know when I'm gonna work on some of the tasks). |
Just want to let you know that I probably won't be able to work on the conditional types this week. I was planning on doing more but life is busy as well :) |
No problem, I'm gonna ping you once I take over a task :) |
efdf2c2
to
c4747ec
Compare
c4747ec
to
5d33443
Compare
I'm interested in not generalizing the types, but IMHO it needs to be paired with this suggestion phpstan/phpstan#6732 (comment) to be usable. The whole thread is worth reading, but here I especially refer to the |
5d33443
to
844fc94
Compare
844fc94
to
9aee02f
Compare
Alright, I realized we can not-generalize types outside of GenericObjectType: #2818 But it's still a BC break so it's going to be bleeding edge-only for now. Inside of GenericObjectType we're gonna need this logic phpstan/phpstan#6732 (comment) But anyway this is still going to fix a lot of issues. |
A little experiment to see what happens. Psalm doesn't generalize template types either, because a
@var
is easy enough to write.