@@ -352,10 +352,10 @@ instance ToIR SC where
352352
353353 ir' (STerm t) = ir t
354354 ir' (UnmatchedCase str) = return $ LError str
355− ir' (ProjCase tm alts) = do alts' <- mapM (mkIRAlt tm) alts
356− tm' <- ir tm
355+ ir' (ProjCase tm alts) = do tm' <- ir tm
356+ alts' <- mapM (mkIRAlt tm') alts
357357 return $ LCase tm' alts'
358− ir' (Case n alts) = do alts' <- mapM (mkIRAlt (P Bound n Erased)) alts
358+ ir' (Case n alts) = do alts' <- mapM (mkIRAlt (LV (Glob n))) alts
359359 return $ LCase (LV (Glob n)) alts'
360360 ir' ImpossibleCase = return LNothing
361361
@@ -379,10 +379,10 @@ instance ToIR SC where
379379 | matchableTy x
380380 = do rhs' <- ir rhs
381381 return $ LDefaultCase rhs'
382− mkIRAlt (P _ orig _) (SucCase n rhs)
382+ mkIRAlt tm (SucCase n rhs)
383383 = do rhs' <- ir rhs
384384 return $ LDefaultCase (LLet n (LOp (LMinus (ATInt ITBig))
385− [LV (Glob orig),
385+ [tm,
386386 LConst (BI 1)]) rhs')
387387-- return $ LSucCase n rhs'
388388 mkIRAlt _ (ConstCase c rhs)