Skip to content

First-class callables and anonymous functions are not isomorphic #11942

@klimick

Description

@klimick

Bug report

This works fine: https://phpstan.org/r/27c3e894-f688-4381-aac6-699ecf3aa64f
Now let's try generic callable types from 1.10.60 release and rewrite some piece of code:

- simple(function($x) {
-    return identity($x);
- });
+ simple(identity(...));

Now PHPStan is angry 🥲

Code snippet that reproduces the problem

https://phpstan.org/r/9f71257d-f292-468e-88ad-a162b01d46e7

Expected output

No errors.

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