Skip to content

Threaded[] = something generates bogus error #6571

@dktapps

Description

@dktapps

Bug report

This probably has to do with the fact that this class implements array-like behaviour without support for ArrayAccess interface (https://github.com/phpstan/phpstan-src/blob/d5e6df75d42ad942f0cd1d592c0faf6a30c85c5d/src/Type/ObjectType.php#L54).
However, PHPStan used to support this case correctly, and now no longer does.

Code snippet that reproduces the problem

https://phpstan.org/r/f3837804-a40f-4c10-a34f-009fb20b925f

Expected output

No error should be reported: Threaded supports array-access.

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