Right now union types are converted to names types in the same scope as the declaration. This can cause an output to have a duplicate typename. This needs to be looked for and eliminated.
Example:
declare module 'test' {
declare function add (x: number | string, y: number | string): number
}
turns into
type number_or_string =
| Number (float)
| String (string);
type number_or_string =
| Number (float)
| String (string);
external add : number_or_string => number_or_string => float = "" [@@bs.module "test"];
Right now union types are converted to names types in the same scope as the declaration. This can cause an output to have a duplicate typename. This needs to be looked for and eliminated.
Example:
turns into