Skip to content

Generic return type resolved from callable return type wrong #9764

@rarila

Description

@rarila

Bug report

As seen it the example code, a closure with return type of ''array<non-empty-string, string>'' is for some reason resolved as ''array<string, string>''.

Code snippet that reproduces the problem

https://phpstan.org/r/ef1c1257-f1a5-4a74-903d-7afaf6b91e9a

Expected output

Expected: ''array<non-empty-string, string>''
Got: ''array<string, string>''.

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

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions