Skip to content

Match arm comparison should not be reported as always true when phpdoc is not certain #8932

@VincentLanglet

Description

@VincentLanglet

Bug report

Since 1.10.0 I get a new error
Match arm comparison between 'B' and 'B' is always true
which shouldn't occur when we're using treatPhpDocAsCertain: false option.

Code snippet that reproduces the problem

https://phpstan.org/r/59058c28-5433-4a80-b1de-84d04d99d294

Expected output

No error since the native type is string.

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

The new @var validation is awesome.

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