vscode-intelephense icon indicating copy to clipboard operation
vscode-intelephense copied to clipboard

Intersected types should produce intersected property type

Open bmewburn opened this issue 6 months ago • 1 comments

class A
{
    public int $a;
    public array $other;
}
class B
{
    public int $b;
}

/** @param A&object{other: array<B>} $x */
function hello(object $x): void
{
    $other = $x->other;
}

$x->other is array<B>, but intelephense only display array. Phpstan properly detect array<B>

Originally posted by @momala454 in https://github.com/bmewburn/vscode-intelephense/issues/2973#issuecomment-2285560103

bmewburn avatar Aug 13 '24 08:08 bmewburn