Skip to content

False positive "Result of && is always false" despite "treatPhpDocTypesAsCertain: false" #4969

@anbuc

Description

@anbuc

Bug report

I have defined an array shape with an optional key. When checking the type of the value from that optional but typed key, I get the error mentioned in the title, even after I added the parameter to not treat PhpDoc as certain.

So far so good. If I reorder the checks or if I make the key no longer optional, it works as expected, even though reordering the code would not change the logic at

Code snippet that reproduces the problem

Expected output

No error reported in both cases

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions