Skip to content

Commit

Permalink
feat: start recovering errors locally instead of at the top level
Browse files Browse the repository at this point in the history
Goal is to keep as much information as possible about local types to
improve the language server
  • Loading branch information
aboeglin committed Jun 8, 2024
1 parent b05d34b commit 1430483
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion compiler/main/Infer/Exp.hs
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,13 @@ inferApp options env (Can.Canonical area (Can.App abs@(Can.Canonical absArea _)
else
arg

s3 <- contextualUnify env expForContext (apply s2 t1) (apply s1 t2 `fn` tv)
s3 <- catchError
(contextualUnify env expForContext (apply s2 t1) (apply s1 t2 `fn` tv))
(\err -> do
pushError err
unify (getReturnType t1) tv
)

let t = apply s3 tv
let s = s3 `compose` s2 `compose` s1

Expand Down

0 comments on commit 1430483

Please sign in to comment.