@@ -715,13 +715,15 @@ simplifyCasedef :: Name -> Context -> Context
715715simplifyCasedef n uctxt
716716 = let ctxt = definitions uctxt
717717 ctxt' = case lookupCtxt Nothing n ctxt of
718+ [(CaseOp inl ty [] ps args sc args' sc', acc, tot)] ->
719+ ctxt -- nothing to simplify (or already done...)
718720 [(CaseOp inl ty ps_in ps args sc args' sc', acc, tot)] ->
719721 let pdef = map debind $ map simpl ps_in in
720722 case simpleCase False True CompileTime (FC "" 0) pdef of
721723 OK (CaseDef args sc _) ->
722−-- trace ("Simplify " ++ show n ++ "\n" ++
723−-- show sc) $
724− addDef n (CaseOp inl ty ps_in ps args sc args' sc',
724+-- Erase the original patterns, since we won't use them again and it
725+-- only clutters the .ibc
726+ addDef n (CaseOp inl ty [] ps args sc args' sc',
725727 acc, tot) ctxt
726728 _ -> ctxt in
727729 uctxt { definitions = ctxt' }