bmewburn / vscode-intelephense

PHP intellisense for Visual Studio Code
https://intelephense.com
Other
1.56k stars 92 forks source link

v1.11.0 Calling a static method of type class-string<Foo> gives an error #2920

Closed ChinaMoli closed 2 days ago

ChinaMoli commented 4 days ago

Describe the bug Calling a static method of type class-string<Foo> in strict mode will prompt Expected type 'string|object'. Found 'class-string<Foo>'

To Reproduce

<?php

declare(strict_types=1);

class Foo
{
    public static function Bar()
    {
        return 'bar';
    }
}

$foo = Foo::class;
var_dump($foo::Bar());
// bar

Expected behavior There should be no errors.

Screenshots PixPin_2024-06-29_17-10-52

Platform and version OS: Windows 10 WSL2 Intelephense version: v1.11.0 (pre-release)