Skip to content

Void return of yield used, not reported #2873

@dktapps

Description

@dktapps

Bug report

Generator<int, int, void, void> accepts no values via send(), but using the return value of yield does not raise an error in this case.

Version is 0.12.5.

Code snippet that reproduces the problem

https://phpstan.org/r/d39c8d97-e3ee-4259-932d-e4b1998aab54

Only one error is reported in this code.

Expected output

An additional error should be reported because the return type of yield is void in this generator.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions