🌐 US-Proxy
class="logged-out env-production page-responsive" style="word-wrap: break-word;" >
Skip to content

Infered type from template-type in trait create errors based on using classes #13474

Description

@vdauchy

Bug report

The use of @return template-type<T, ModelInterface, 'TValue'> on a function defined in a trait adapt the infered type to the using class in a way that creates errors for each possible use.

Code snippet that reproduces the problem

https://phpstan.org/r/dde1c228-ac3f-4660-9a5f-ecb53b439f7d

Expected output

No error.

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

Yes, really helpful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions