Skip to content

False positive: Generator actually has a method throw() #3683

@corphi

Description

@corphi

Bug report

The current version (0.12.33) complains that Generator doesn't have a method throw(). Version 0.12.32 didn't have this issue. It seems to only happen when the Generator type is declared.

Code snippet that reproduces the problem

With type declaration:
https://phpstan.org/r/2e1b8339-5519-4e10-9994-f034d125d2ab

Without it:
https://phpstan.org/r/f69069bc-daee-408b-a39f-d65c23a18eab

Expected output

No error should be reported.

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