aboutsummaryrefslogtreecommitdiff
path: root/src/Compiler.hs
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2022-08-16 23:37:40 +0100
committerJuan J. Martinez <jjm@usebox.net>2022-08-16 23:37:40 +0100
commit007b1e966d4234f2fbdc8f21d53b27dec0060b5e (patch)
tree99e02aa703470bff74f4711d1c3bd91379b897e5 /src/Compiler.hs
parent7ac5c089d447c11bb9c9152bb30e1cff5b96267e (diff)
downloadmicro-lang-hs-007b1e966d4234f2fbdc8f21d53b27dec0060b5e.tar.gz
micro-lang-hs-007b1e966d4234f2fbdc8f21d53b27dec0060b5e.zip
Unexpected return error
Diffstat (limited to 'src/Compiler.hs')
-rw-r--r--src/Compiler.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Compiler.hs b/src/Compiler.hs
index da25c5d..413a041 100644
--- a/src/Compiler.hs
+++ b/src/Compiler.hs
@@ -121,7 +121,7 @@ compile x = do
(A.Return value pos) -> do
(ev, errs) <- get
case getSyml ev "$fn$" of
- Nothing -> addError $ Error "return without function call" pos
+ Nothing -> addError $ UnexpectedReturn "return without function call" pos
Just (_, A.FuncType _ rtyp, _) -> do
r <- typecheckReturn value rtyp
case r of