code: public String typeExprForRecordMember(boolean isOptional) {
      if (typeExpressions.size() > 1 || isOptional) {
        // needs parens
        return "("
            + typeExpr()
            + (isOptional && !typeExpressions.contains("undefined") ? "|undefined" : "")
            + ")";
      }
      return typeExpr();
    }
docs: Returns a type expression for a record member. In some cases this requires additional parens.