Skip to content

Match considered non exhaustive when matching arrays of unions #11453

@PrOF-kk

Description

@PrOF-kk

Bug report

Phpstan reports a non-exhaustive match expression when matching arrays of unions. The matched array's type is correct when dumping (phpstan: Dumped type: array{1|2|3, 'a'|'b'|'c'})

Code snippet that reproduces the problem

https://phpstan.org/r/d2d681c2-f6c7-4f2f-a06b-2cb5f1698770

Expected output

No output from phpstan since the match expression is exhaustive

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

I love PHPStan, it makes me a better developer :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions