fix EvVoid ts conversion

This commit is contained in:
Vyacheslav Matyukhin 2022-07-29 23:35:11 +04:00
parent 482ceb76dc
commit 52bee6a0e3
No known key found for this signature in database
GPG Key ID: 3D2A774C5489F96C

View File

@ -18,6 +18,7 @@ import { tagged, tag } from "./types";
// Raw rescript types. // Raw rescript types.
export type rescriptExport = export type rescriptExport =
| 0 // EvVoid
| { | {
TAG: 0; // EvArray TAG: 0; // EvArray
_0: rescriptExport[]; _0: rescriptExport[];
@ -140,6 +141,10 @@ export function convertRawToTypescript(
result: rescriptExport, result: rescriptExport,
environment: environment environment: environment
): squiggleExpression { ): squiggleExpression {
if (typeof result === "number") {
// EvVoid
return tag("void", "");
}
switch (result.TAG) { switch (result.TAG) {
case 0: // EvArray case 0: // EvArray
return tag( return tag(