Skip to content

List (key) in by-reference param is checked too strictly #12330

Description

@rudiedirkx

Bug report

If I set an existing key in a list, Phpstan complains about it not being a list anymore. (I think that's what the complaint is about, it's not very readable.) But the keys didn't change, or the order, only a part inside a list element. If I type the list as array<int, ABC> there's no problem, because any key allowed I guess, but hinted as list<ABC> is's an error.

Code snippet that reproduces the problem

https://phpstan.org/r/47c1de12-667b-42f9-93de-5b0464cad896

Expected output

No error, because no list keys/indexes are changed. The mixed (level 6) isn't a part of this bug.

Simpler reproduction without mixed: https://phpstan.org/r/c4dd4b76-92d6-4b30-a489-858fb6f4d932

Did PHPStan help you today? Did it make you happy in any way?

No response

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions