Skip to content

PHPDoc types from overridden function are not included in trait typeinfo when aliased #9733

@dktapps

Description

@dktapps

Bug report

Scenario:

  • Base class declares abstract function with array typed parameter
  • Trait implements this function
  • Trait is used by a class extending Base

This regression appeared at 1.10.23.

Code snippet that reproduces the problem

https://phpstan.org/r/55fe8850-e6be-4c67-8bc9-63017a40638e
https://phpstan.org/r/86006153-0f1b-4760-aeb7-4f2dfd3dd546

Expected output

No error should be reported.

Additionally, the dumped type should be array<int> or similar in the context of the Concrete class.

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

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions