rescript-association / genType

Auto generation of idiomatic bindings between Reason and JavaScript: either vanilla or typed with TypeScript/FlowType.

Home Page:https://rescript-lang.org/docs/gentype/latest/introduction

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Non-Unary Variant generated types don't match the output values

chrischen opened this issue · comments

If I have a non-unary variant like this

type typeL = | NonUnary(int, int);
let makeVariant = () => NonUnary(5, 3);

JS output is

{ _0: 5, _1: 3 }

Generated type is

export type nonUnary = [number, number];
makeVariant: () => nonUnary

So it's expecting an array of the arguments (which are ints), but actually get back the internal BS object representation.