Skip to content

False positive for return type of generic method #3117

@amorimjuliana

Description

@amorimjuliana

Bug report

In the first error, it looks like the instanceof operator does not take into account final classes. In the second, even the message is unclear about why the return type is considered invalid.

Code snippet that reproduces the problem

https://phpstan.org/r/de789d49-1c85-4a3c-b3b8-b71adac4e572

Expected output

No errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions