Skip to content

Parent constructor calls don't reset field type assumptions #4351

@dktapps

Description

@dktapps

Bug report

A parent constructor call should be considered the same as a void method in terms of its side effects, but it seems not to be.

Code snippet that reproduces the problem

https://phpstan.org/r/8fe57cd0-e03f-44d4-a833-cc058de14a77
Demonstration: https://3v4l.org/ZVjQ5

Expected output

An error should be reported on line 21 that doSomething() is being called on Thing|null.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions