Skip to content

v1.8.3: Weird error message for static array with enum values #7933

@tlamy

Description

@tlamy

Bug report

Since PhpStan 1.8.3 I get a false error message
Static property Demo\CountryMapper::$countryISOMapping (array<literal-string, all-enum-values>) does not accept default value of type non-empty-array<literal-string&non-falsy-string, literal-string&non-falsy-string>.

In versions up to 1.8.2, phpstan did not complain, and I triple checked.

I couldn't come up with a minimal test case, so I have included the original source in https://github.com/tlamy/phpstan-1.8.3-issue .

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