Skip to content
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

ArrayAccess generics got broken in 1.7.x #7323

Closed
janedbal opened this issue May 26, 2022 · 2 comments
Closed

ArrayAccess generics got broken in 1.7.x #7323

janedbal opened this issue May 26, 2022 · 2 comments

Comments

@janedbal
Copy link
Contributor

Bug report

Following invalid error popped up when upgraded from 1.6.8 to 1.7.1

Code snippet that reproduces the problem

https://phpstan.org/r/c58cde7c-9f0c-4d6b-8fa0-818b739b8c86

Expected output

No error

@ondrejmirtes
Copy link
Member

Because PHPStan now knows about default parameter values, it sees ArrayObject is created with [] and therefore: https://phpstan.org/r/be5f50f5-0872-44fe-9f5e-1ea71e260b13

Right now you need to add /** @var ArrayObject<something, something> */ to your code. It might work nicer when this is implemented: #6732

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants