Skip to content

Generics false positive "should return T of [class] but returns [class]" #4411

@MartinMystikJonas

Description

@MartinMystikJonas

Bug report

Method A::get() should return T of Exception but returns Exception.

Code snippet that reproduces the problem

https://phpstan.org/r/d807aba0-2152-40af-9ae3-ce710cc1df76

Expected output

This should not raise error.

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