Skip to content

Iterable does not work in template #12214

@julien-fontaine

Description

@julien-fontaine

Bug report

Hello!

I am encountering an issue when using the iterable type within the @template tag. It appears that this usage is not supported and results in multiple warnings. The underlying cause seems to be related to generics.notSupportedBound.

The issue does not occur when iterable is used outside of the @template annotation, or when using array instead of iterable within the template context.

I am unsure whether this is a bug or if it is intended behavior.

Code snippet that reproduces the problem

https://phpstan.org/r/14288c00-8257-4855-8372-7b70a3eeb7ff

Expected output

No errors!

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

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions