Skip to content

Commit

Permalink
fix caseCmd for RepConstr
Browse files Browse the repository at this point in the history
  • Loading branch information
janmasrovira committed Feb 21, 2024
1 parent 999f539 commit d4824d8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Juvix/Compiler/Nockma/Translation/FromTree.hs
Original file line number Diff line number Diff line change
Expand Up @@ -685,8 +685,13 @@ caseCmd arg defaultBranch = \case
OpEq
# constructorTagToTerm tag
# (getConstructorField ConstructorTag arg)
elseBr <- caseCmd arg defaultBranch bs
return (branch cond b elseBr)
case nonEmpty bs of
Nothing -> case defaultBranch of
Nothing -> return b
Just defbr -> return (branch cond b defbr)
Just ((t', b') :| bs') -> do
elseBr <- goRepConstr t' b' bs'
return (branch cond b elseBr)

asNockmaMemRepListConstr :: Tree.Tag -> Sem r NockmaMemRepListConstr
asNockmaMemRepListConstr tag = case tag of
Expand Down

0 comments on commit d4824d8

Please sign in to comment.