Skip to content

Trait method typehint override bugged #3142

@Korbeil

Description

@Korbeil

Bug report

When using @method annotation to override a trait typehint, it doesn't work as expected.
PHPStan should get our typehint from the annotation.
I saw that @method annotations does work for unknown methods but not when the method exists.

Code snippet that reproduces the problem

https://phpstan.org/r/29222d5c-c550-480a-97a1-7388c83c41f7

Expected output

Output should be green

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