Skip to content

Conversation

herndlm
Copy link
Contributor

@herndlm herndlm commented Sep 20, 2024

Those keep being lists.

Fixes phpstan/phpstan#11718

@herndlm herndlm marked this pull request as draft September 20, 2024 10:12
@herndlm
Copy link
Contributor Author

herndlm commented Sep 20, 2024

nope, I was overlooking https://3v4l.org/n5E7F

so the array is a list until another element is added again. ouch. might need changes to setOffsetValueType() too..

UPDATE: adapted

@herndlm herndlm marked this pull request as ready for review September 20, 2024 11:44
@phpstan-bot
Copy link
Collaborator

This pull request has been marked as ready for review.

@ondrejmirtes
Copy link
Member

Closing because of: phpstan/phpstan#11718 (comment)

@herndlm herndlm deleted the bug-11718 branch September 20, 2024 14:58
@herndlm
Copy link
Contributor Author

herndlm commented Sep 20, 2024

ok. the changes here made the "array with last item unset"-is-still-a-list part work while also removing the list when more is assigned. it indeed feels slightly weird and a non-well-defined state though

@ondrejmirtes
Copy link
Member

We can't do that because if you passed it somewhere else as a list, and the other place appended an element, the assumption would be broken, and PHPStan would think it has a list but in reality it wouldn't be a list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants