Fix lost list-type if substituted a element via loop#3908
Fix lost list-type if substituted a element via loop#3908ondrejmirtes merged 4 commits intophpstan:2.1.xfrom
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
ondrejmirtes
left a comment
There was a problem hiding this comment.
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