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

`uniontype` has wrong start loc

Open abdul-alhasany opened this issue 2 years ago • 0 comments

Hi When using uniontype the parser is providing the wrong loc data.

Example:

function functionWithMultipleTypes(int $arg1, $arg2): string|int {
    return 'foo';
}

The union type string|int provides this loc:

start: {
line: 3, 
column: 65, <-- This is wrong
offset: 72 <-- This is wrong
}
end: {
line: 3,
column: 64,
offset: 71
}

end location data is correct.

abdul-alhasany avatar Jul 27 '23 00:07 abdul-alhasany