mirror of
https://github.com/carp-lang/Carp.git
synced 2024-09-17 16:38:14 +03:00
fix: don't combine internal envs in closures (#1126)
This commit is contained in:
parent
381fa0f179
commit
9bd44227c3
@ -313,7 +313,9 @@ eval ctx xobj@(XObj o info ty) preference resolver =
|
||||
(newCtx, evaledArgs) <- foldlM successiveEval (ctx, Right []) args
|
||||
case evaledArgs of
|
||||
Right okArgs -> do
|
||||
(_, res) <- apply (c {contextHistory = contextHistory ctx} <> ctx) body params okArgs
|
||||
let newGlobals = (contextGlobalEnv newCtx) <> (contextGlobalEnv c)
|
||||
newTypes = TypeEnv $ (getTypeEnv (contextTypeEnv newCtx)) <> (getTypeEnv (contextTypeEnv c))
|
||||
(_, res) <- apply (c {contextHistory = contextHistory ctx, contextGlobalEnv = newGlobals, contextTypeEnv = newTypes}) body params okArgs
|
||||
pure (newCtx, res)
|
||||
Left err -> pure (newCtx, Left err)
|
||||
XObj (Lst [XObj Dynamic _ _, sym, XObj (Arr params) _ _, body]) i _ : args ->
|
||||
|
Loading…
Reference in New Issue
Block a user