-
Notifications
You must be signed in to change notification settings - Fork 523
Fix lost list-type if substituted a element via loop #3908
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
Conversation
|
I am not sure about the impl, as it e.g. does not work for the regular edit: logged as a new issue so its not forgotten |
|
This pull request has been marked as ready for review. |
a25c713 to
4133a04
Compare
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.
This is nice, I have two ideas for improvements:
- Try to do this logic in produceArrayDimFetchAssignValueToWrite instead, I suspect it might work for nested assigns (
$a[$i][$j]) as well. - Try calling
setExistingOffsetValueTypeinstead ofsetOffsetValueTypein this scenario. Right now I think it's used for some weird thing aroundunsetbut I suspect it might be a bit more elegant. We need to fix howAccessoryArrayListType::setExistingOffsetValueTypeis implemented too.
These are just ideas - if they don't work, I'm happy to revert to the current state and merge it as it is. Thanks!
|
I have implemented 1) - it works like you suspected. regarding 2) - what are the expectations with |
Nevermind, probably not a good idea 😊 |
|
Thank you! |
closes phpstan/phpstan#12274