Skip to content

Iterating over type with static #4267

@ondrejmirtes

Description

@ondrejmirtes

Bug report

Originally reported: #4220

Both versions with generics and without generics should work.

It might just be a matter of modifying ObjectType::getIterableValueType(), to resolve the StaticType (similar to this https://github.com/phpstan/phpstan-src/blob/19bf582aa3c0e0809446a17399d17d17ab40297c/src/Analyser/MutatingScope.php#L4515-L4526).

Code snippet that reproduces the problem

Expected output

Correctly resolved $h to HelloWorld.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions