bmewburn / intelephense-docs

Documentation for the Intelephense PHP language server
https://intelephense.com
Other
184 stars 17 forks source link

Destructing generic array object doesn't provide type hints #59

Closed radmen closed 1 year ago

radmen commented 1 year ago

I'm sorry for the weird title. First, I'll start with the example:

<?php

class Test
{
    public function __construct(public int $i) { }
}

/** @var ArrayObject<int, Test> */
$list = new ArrayObject([
    new Test(1),
    new Test(2),
]);

[$first, $second] = $list;

When I type $list[0]->, the LSP will provide type hints for the \Test class.
It won't work, however, when I type $first->.

Intelephense version: 1.9.5

radmen commented 1 year ago

I think this is the wrong repo. Closing this one and moving to https://github.com/bmewburn/vscode-intelephense/issues