Skip to content

Retain list type when assigning to offset 1 of non-empty-list#3682

Merged
ondrejmirtes merged 3 commits intophpstan:1.12.xfrom
herndlm:list-assign-offset-1
Nov 27, 2024
Merged

Retain list type when assigning to offset 1 of non-empty-list#3682
ondrejmirtes merged 3 commits intophpstan:1.12.xfrom
herndlm:list-assign-offset-1

Conversation

@herndlm
Copy link
Copy Markdown
Contributor

@herndlm herndlm commented Nov 27, 2024

Fixes phpstan/phpstan#12131

I don't think we can detect this edge case inside Type::setOffsetValueType() because we need info of 2 different accessory types, right? Is IntersectionType the best place then I suppose?

@herndlm herndlm force-pushed the list-assign-offset-1 branch from cb52ced to 5570289 Compare November 27, 2024 15:04
@ondrejmirtes ondrejmirtes merged commit 0b925a9 into phpstan:1.12.x Nov 27, 2024
@ondrejmirtes
Copy link
Copy Markdown
Member

Thank you.

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