Skip to content

Strict rule "Instanceof between A and A will always evaluate to true." may be counter productinve in a match arm #8042

@arnaud-lb

Description

@arnaud-lb

Bug report

The strict rule "Instanceof between X and Y will always evaluate to true." may be counter productive in a match arm. The error can be fixed by using a default arm, but this defeats exhaustive checking.

Code snippet that reproduces the problem

https://phpstan.org/r/329298a8-f263-4d56-a073-ac92769ee3bd

Expected output

No error

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

PHPStan is great!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions