Skip to content

union of literal strings in types after if conditions #6439

@staabm

Description

@staabm

Bug report

I am wondering why the union type in the 2nd dump of the snippet turns into a intersection type instead of a union of more elements.

any hint on where to fix? I could have a look into a fix myself, I guess.

Code snippet that reproduces the problem

https://phpstan.org/r/57cab594-5602-416d-ac69-ae83f07c1064

Expected output

see assertion in snippet

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