Skip to content

(Generics) Type lost after comparison #12894

@LastDragon-ru

Description

@LastDragon-ru

Bug report

Please see example, PHPStan loses the type of $resolved after is_object($resolved) ? 1 : 2 (or if (...)).

Code snippet that reproduces the problem

https://phpstan.org/r/ce1c6c2c-257c-4f12-9220-7c730850124a

Expected output

Dumped type: V of object|null (method DependencyResolver::resolve(), argument) instead of just V

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