Skip to content

False positives with return in generators using yield from #3407

@stof

Description

@stof

Bug report

When a generator method uses yield from rather than yield, it looks like it is not identified as a generator. The analyser complains about the usage of return; which does not return an iterable.

Code snippet that reproduces the problem

https://phpstan.org/r/d23f70ca-1525-4ba6-947c-f55187988a87

Expected output

No issue reported for the return; statement

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions