Skip to content

Level 6 cannot resolve type if one or more types from union is not subtype of template #12558

@mvorisek

Description

@mvorisek

Bug report

This is contrary to how level <=6 is supposed to work.

Code snippet that reproduces the problem

https://phpstan.org/r/c0fc78fc-9633-4e54-8888-f4426aa6e83c

Expected output

No PHPStan error, at least when nullable type (passing type unined with null) is passed for level <=6.

Also, as I had to dump the input type myself when debugging, I would welcome the "Unable to resolve the template type..." error message to contain the given type to be able understand the problem quickly just from the message.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions