From 52bee6a0e36527b53394bd281247431f162095d1 Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Fri, 29 Jul 2022 23:35:11 +0400 Subject: [PATCH] fix EvVoid ts conversion --- packages/squiggle-lang/src/js/rescript_interop.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/squiggle-lang/src/js/rescript_interop.ts b/packages/squiggle-lang/src/js/rescript_interop.ts index 80548a7f..3dca8165 100644 --- a/packages/squiggle-lang/src/js/rescript_interop.ts +++ b/packages/squiggle-lang/src/js/rescript_interop.ts @@ -18,6 +18,7 @@ import { tagged, tag } from "./types"; // Raw rescript types. export type rescriptExport = + | 0 // EvVoid | { TAG: 0; // EvArray _0: rescriptExport[]; @@ -140,6 +141,10 @@ export function convertRawToTypescript( result: rescriptExport, environment: environment ): squiggleExpression { + if (typeof result === "number") { + // EvVoid + return tag("void", ""); + } switch (result.TAG) { case 0: // EvArray return tag(