From 646e018c9f09bb122b7fa1d9270f6cfc6bd06dd7 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Sun, 14 Aug 2022 08:02:47 +0100 Subject: Return the type of the function This makes lambda calls work. --- src/Compiler.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/Compiler.hs') diff --git a/src/Compiler.hs b/src/Compiler.hs index e69ab77..c8889b6 100644 --- a/src/Compiler.hs +++ b/src/Compiler.hs @@ -38,7 +38,7 @@ compile x = do (ev, errs) <- get -- updated with the function (ev, errs) <- - return $ case addSymUniq ev (ident, A.toFuncType params ret, pos) of + return $ case addSymUniq ev (ident, ftype, pos) of Left err -> (ev, err : errs) Right ev -> (ev, errs) -- with parameters @@ -48,7 +48,9 @@ compile x = do (_, errs) <- get -- store updated errors and the env with the function put (ev, errs) - return $ r + return $ Right $ Just ftype + where + ftype = A.toFuncType params ret (A.Call ident args pos) -> do r <- compile ident case r of -- cgit v1.2.3