Skip to content

An object's property type narowing doesn't work if there's an inherited method called after it #6623

@fluffycondor

Description

@fluffycondor

Bug report

If I narrow type of a private property of an object, it resets its type if I call any method of the object's parent. But there's no way parent can fiddle with its child's private properties.

Code snippet that reproduces the problem

https://phpstan.org/r/642390af-0c8a-4eb4-876b-c2c54143b0fd

Expected output

I expect the dumped type in both cases is int.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions