Unresolvable type with arrow function and array · Issue #14844 · phpstan/phpstan · GitHub
Skip to content

Unresolvable type with arrow function and array #14844

Description

@canvural

Bug report

I don't really understand what is going on here. The return type of doFoo is correctly inferred from the arrow function. But still there is a unresolvable type error. Which seems wrong cause it's clearly resolved 😄

Also, it only happens with bleeding edge. Which made me think it might be related to sealed arrays, but have no idea how it can be connected.

Code snippet that reproduces the problem

https://phpstan.org/r/67d9b0bf-d373-4b95-926b-df6c11ec1f6e

Expected output

No errors

Did PHPStan help you today? Did it make you happy in any way?

Always! Especially with AI writing code now, it's so satisfying to make new PHPStan rules every time we notice a mistake the agent made.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions