Skip to content

Closure signature PHPDoc seems to corrupt variadics #3506

@dktapps

Description

@dktapps

Bug report

PhpDoc describing Closure signatures seems to break the type of variadic closure parameters.

Code snippet that reproduces the problem

https://phpstan.org/r/131d81a7-ffa4-4ee5-bf1e-1028b0bd478b
checkExplicitMixed: true is required to reproduce this bug.

If I remove the mixed... parameter from the PhpDoc, it shuts up.

Expected output

No errors.

Actual output

 ------ -------------------------------------------------------------
  Line   Test.php
 ------ -------------------------------------------------------------
  15     Only iterables can be unpacked, mixed given in argument #1.
 ------ -------------------------------------------------------------

 [ERROR] Found 1 error

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions