Skip to content

Type list is lost if you substitute a element via loop #12274

@KorDum

Description

@KorDum

Bug report

PhpStan loses list type if you override any element in it.
I took my example and line by line stripped out the unnecessary, so don't mind that it's "illogical". I actually substitute one particular element in the actual code if I could find it.

Code snippet that reproduces the problem

https://phpstan.org/r/702312c5-fb75-457b-876b-8bd366d1eb80

Expected output

I expect PhpStan to retain the understanding that it has a list type, which only substitutes elements (all or some).

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

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions