Fix double vars

This commit is contained in:
Martin Fredin 2023-03-29 22:48:26 +02:00
parent 343be08a4a
commit aa1ff630a5

View file

@ -100,7 +100,7 @@ typecheckBind (Bind name vars rhs) = do
-- Γ ⊢ f xs = e ↓ Α → B ⊣ Δ
Just t -> do
(rhs', _) <- check (foldr EAbs rhs vars) t
pure (T.Bind (coerce name, t) (coerce vars') (rhs', t))
pure (T.Bind (coerce name, t) [] (rhs', t))
where
vars' = zip vars $ getVars t
@ -111,9 +111,7 @@ typecheckBind (Bind name vars rhs) = do
(e, t) <- infer $ foldr EAbs rhs vars
t' <- applyEnv t
e' <- applyEnvExp e
let rhs' = skipLambdas (length vars) e'
vars' = zip vars $ getVars t'
pure (T.Bind (coerce name, t') (coerce vars') (rhs', t'))
pure (T.Bind (coerce name, t') [] (e', t'))
env <- gets env
unless (isComplete env) err
putEnv Empty