Skip to content

Promoted vs. regular property inconsistency with generics #13049

@staabm

Description

@staabm

Bug report

I have 2 equivalent classes. one is using promoted properties, while the other one uses regular properties.

only in one of the classes we get a generics error:

Template type Value is declared as covariant, but occurs in invariant position in property LanguageProperty2::$value.

Code snippet that reproduces the problem

https://phpstan.org/r/0c390d54-fa09-47bf-a062-33c7675c515c

Expected output

I am not sure, but I feel the 2 code examples should trigger the same errors..?

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