Skip to content

Labeled arguments seem to not be output appropriately #6361

Closed
@sgrove

Description

@sgrove

Porting from rescript-association/genType#635

For example, for a given function:

@genType
let basicExample = (
  ~kind,
  ~title,
  ~camelCaseName,
  ~id,
  ~description,
  ~sourceCode,
  ~localSchema: string,
  ~upstreamDependencies,
) => {
 ()
}

Outputs this javascript:

function basicExample(
  nodeFilepath,
  node,
  onSuccess,
  onError,
  nodePayload,
  nodeInput,
  whichEval,
) {}

but outputs this .gen.tsx:

export const basicExample: <T1, T2, T3, T4>(_1: {
  readonly nodeFilepath: T1;
  readonly node: Compiler_Structures_Node_t;
  readonly onSuccess: T2;
  readonly onError: (_1: exn) => void;
  readonly nodePayload: T3;
  readonly nodeInput: T4;
  readonly whichEval:
    | "full"
    | "inputToPrompt"
    | "inputToSystemPrompt"
    | "payloadToInput";
}) => void = HyperEvalBS.basicExample;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions