Skip to content

When copying Ds Sequence phpstan thinks the result is not Sequence but parent Collection #5638

@simPod

Description

@simPod

Bug report

\Ds\Sequence::copy() produces Sequence. PHPStan widens the type to Collection

I checked the stubs and it all looks fine, can't spot the error 🤔

Code snippet that reproduces the problem

https://phpstan.org/r/60352de3-d6df-4634-83a6-2104febe575e

Expected output

No errors


I waited until phpstan/phpstan-src#675 was deployed to playground but it did not fix it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions