Skip to content

@phpstan-assert isn't working with Union - part 2 #14108

@staabm

Description

@staabm

Bug report

in phpstan/phpstan-src#4900 we added support for @phpstan-assert on unions.
I think the implementation is wrong, as the snippet suggests

Code snippet that reproduces the problem

https://phpstan.org/r/9a1e59a3-dba3-41b4-b097-ab84f6f98e4f

Expected output

no errors

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

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions