*/ private array $arguments; /** * @param class-string $className */ public function __construct(string $className, Node ...$arguments) { $this->className = $className; $this->arguments = $arguments; } public function compile(Compiler $compiler): Compiler { $arguments = array_map( fn (Node $argument) => $compiler->sub()->compile($argument)->code(), $this->arguments, ); $arguments = implode(', ', $arguments); return $compiler->write("new {$this->className}($arguments)"); } }