Skip to content

Commit

Permalink
fix caseCmd for RepConstr
Browse files Browse the repository at this point in the history
  • Loading branch information
janmasrovira authored and paulcadman committed Feb 23, 2024
1 parent be2cb5c commit 3b53204
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 @@ -753,8 +753,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 3b53204

Please sign in to comment.