Skip to content

@phpstan-assert is resolved too early, not working in child classes #12548

@mvorisek

Description

@mvorisek

Bug report

The resolving of @phpstan-assert-if-true can be related with #11289.

@phpstan-assert and @phpstan-assert-if-true is working quite differently, please correct me wrong, but as long as the return type is always truthy, both should narrow the type the same.

Code snippet that reproduces the problem

https://phpstan.org/r/d60a68af-b85d-4313-950f-fe5e292383c0

Expected output

no phpstan error

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions