public function appendToBuilder()

in src/CodegenType.hack [56:70]


  public function appendToBuilder(HackBuilder $builder): HackBuilder {
    invariant(
      $this->type !== null || $this->codegenShape !== null,
      'You need to set either the type or the shape',
    );
    $builder->addf('%s %s = ', $this->keyword, $this->name);
    if ($this->type !== null) {
      return $builder->add($this->type)->closeStatement();
    }
    invariant(
      $this->codegenShape !== null,
      'Somehow the type and the shape were null!',
    );
    return $builder->addRenderer($this->codegenShape)->closeStatement();
  }