@@ -715,13 +715,15 @@ simplifyCasedef :: Name -> Context -> Context
715simplifyCasedef n uctxt
715simplifyCasedef n uctxt
716 = let ctxt = definitions uctxt
716 = let ctxt = definitions uctxt
717 ctxt' = case lookupCtxt Nothing n ctxt of
717 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...)
718 [(CaseOp inl ty ps_in ps args sc args' sc', acc, tot)] ->
720 [(CaseOp inl ty ps_in ps args sc args' sc', acc, tot)] ->
719 let pdef = map debind $ map simpl ps_in in
721 let pdef = map debind $ map simpl ps_in in
720 case simpleCase False True CompileTime (FC "" 0) pdef of
722 case simpleCase False True CompileTime (FC "" 0) pdef of
721 OK (CaseDef args sc _) ->
723 OK (CaseDef args sc _) ->
722−-- trace ("Simplify " ++ show n ++ "\n" ++
724+-- Erase the original patterns, since we won't use them again and it
723−-- show sc) $
725+-- only clutters the .ibc
724− addDef n (CaseOp inl ty ps_in ps args sc args' sc',
726+ addDef n (CaseOp inl ty [] ps args sc args' sc',
725 acc, tot) ctxt
727 acc, tot) ctxt
726 _ -> ctxt in
728 _ -> ctxt in
727 uctxt { definitions = ctxt' }
729 uctxt { definitions = ctxt' }