Skip to content

Commit

Permalink
fix closure traversal bug
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszcz committed Mar 30, 2023
1 parent 9e9a884 commit d7f622d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Juvix/Compiler/Core/Extra/Base.hs
Original file line number Diff line number Diff line change
Expand Up @@ -714,10 +714,12 @@ destruct = \case
NodeDetails
{ _nodeInfo = i,
_nodeSubinfos = [],
_nodeChildren = oneBinder bi b : map noBinders env,
_nodeChildren = manyBinders binders b : map noBinders env,
_nodeReassemble = someChildren $ \i' (b' :| env') ->
Closure env' (Lambda i' bi b')
}
where
binders = replicate (length env) (mkBinder' mkDynamic') ++ [bi]

reassembleDetails :: NodeDetails -> [Node] -> Node
reassembleDetails d ns = (d ^. nodeReassemble) (d ^. nodeInfo) (d ^. nodeSubinfos) ns
Expand Down

0 comments on commit d7f622d

Please sign in to comment.