Skip to content

False positive on new @var lying detection as phpstan cannot infer type from callback #8936

@simPod

Description

@simPod

Bug report

PHPDoc tag @var with type Ds\Map<string, array{a: int}> is not subtype of type Ds\Map<mixed, array>.

PHPStan throws away the type from anonymous function and declares it as mixed.

Code snippet that reproduces the problem

https://phpstan.org/r/1b229552-a407-4a05-b91f-029b1846395f

Expected output

No errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions