zobo / php-language-server

PHP Implementation of the VS Code Language Server Protocol 🆚↔🖥
ISC License
57 stars 12 forks source link

"Integer" looks like a reserved keyword #24

Open Zekfad opened 2 years ago

Zekfad commented 2 years ago

Following code produces errors while it shouldn't:

class Integer {
    public function a(): Integer // 'ReturnType' expected // '{' expected
    { // '}' expected
        return $this;
    }
}
zobo commented 2 years ago

I am currently traveling and can't check this yet. But do try public function a(): self instead of Integer.

Does the problem also happen if the class name is something else, not Integer?

Best!

Zekfad commented 2 years ago

self produces no error, but that's still an issue, because it's a false error report for a valid PHP code.

I haven't tested other names like that yet.

zobo commented 2 weeks ago

Same as https://github.com/zobo/php-language-server/issues/81 and https://github.com/microsoft/tolerant-php-parser/issues/413