tolerant-php-parser icon indicating copy to clipboard operation
tolerant-php-parser copied to clipboard

Issue with class name alias

Open felixfbecker opened this issue 7 years ago • 2 comments
trafficstars

From @p810 on June 12, 2018 15:3

Given the following code:

<?php

namespace Foo\Bar;

use Foo\Quux\Service as QuuxService;

class Quux { /* ... */ }

I'm getting the following error:

File.php src/Foo
    [php] ';' expected (5, 19)

Copied from original issue: felixfbecker/php-language-server#649

felixfbecker avatar Jun 12 '18 15:06 felixfbecker

Are you able to reproduce it with the exact snippet? The column seems wrong, and I don't see that error.

Maybe the name they are using isn't actually Service, but some other reserved keyword (e.g. https://github.com/Microsoft/tolerant-php-parser/issues/205 has a similar error message)

TysonAndre avatar Jun 12 '18 15:06 TysonAndre

I'll post code that can reproduce the error in a bit; the actual snippet is code that my employer technically owns so I don't know if they'd want me sharing it outside of the organization y'know.

I wrote this code just to demonstrate the error I've been getting. The column may have been counted off because I was just scanning with my eyes and wasn't typing it in my IDE, lol.

p810 avatar Jun 12 '18 16:06 p810