Skip to content

Cannot type static return in generic class #10417

@homersimpsons

Description

@homersimpsons

Bug report

When a Generic class has a function that returns a static it is not possible to change the type of the static using @return annotation.

Code snippet that reproduces the problem

https://phpstan.org/r/cbe16b39-67dd-4efb-a8dd-2fbcb6e281d8

Expected output

No error

Note that the more general issue I want to solve is related to this reproduction, but I think fixing the former will effectively fix this one: https://phpstan.org/r/87ce62b6-4775-4421-8b5b-1dfebf3c4842

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

This tool still is insane in PHP ecosystem. Thank you very much !

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