Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Invalid identification of type when union types is used #7259

@SendiMyrkr

Description

@SendiMyrkr

Bug report

Code snippet that reproduces the problem

https://phpstan.org/r/dca4f949-ab14-41d0-b02d-09adc7ff011e => null
https://phpstan.org/r/ee55e085-aff1-4c4e-9ef6-96ceceec9e83 => string

Expected output

No error.

I belive that errors here are valid for this https://phpstan.org/r/be55ce2b-3aa4-4b6b-9740-2ed53b4bc8ea but in example above is one more "if" that guarantees both variable will have a valid value in time of call method checkDates.

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