phabel icon indicating copy to clipboard operation
phabel copied to clipboard

Named arguments are not properly substituted

Open ian-zunderdorp opened this issue 4 years ago • 1 comments

Given a class:

class Foo {
  public static function foo(string $a, string $b, string $c): self
  { ... }
}

When calling this in the original code:

Foo::foo(a: 'hello', b: 'world', c: '!');

It is transpiled to:

Foo::foo(a: 'hello', b: 'world', c: '!');

This also happens with non-static methods The rest of the transpilation seems to work correctly.

ian-zunderdorp avatar Sep 22 '21 10:09 ian-zunderdorp

Thanks for reporting, named arguments are one of the trickier PHP 8 features that potentially require runtime resolution, though i already have ideas for transpilation-time substitution, that I will implement ASAP :)

danog avatar Sep 27 '21 13:09 danog