@@ -788,7 +788,8 @@ addDatatype (Data n tag ty cons) uctxt
788788 (TyDecl (DCon tag (arity ty')) ty, Public, Unchecked, EmptyMI) ctxt)
789789
790790-- FIXME: Too many arguments! Refactor all these Bools.
791−addCasedef :: Name -> CaseInfo -> Bool -> Bool -> Bool -> Bool ->
791+addCasedef :: Name -> ErasureInfo -> CaseInfo ->
792+ Bool -> Bool -> Bool -> Bool ->
792793 [Type] -> -- argument types
793794 [Int] -> -- inaccessible arguments
794795 [Either Term (Term, Term)] ->
@@ -797,17 +798,17 @@ addCasedef :: Name -> CaseInfo -> Bool -> Bool -> Bool -> Bool ->
797798 [([Name], Term, Term)] -> -- inlined
798799 [([Name], Term, Term)] -> -- run time
799800 Type -> Context -> Context
800−addCasedef n ci@(CaseInfo alwaysInline tcdict)
801+addCasedef n ei ci@(CaseInfo alwaysInline tcdict)
801802 tcase covering reflect asserted argtys inacc
802803 ps_in ps_tot ps_inl ps_ct ps_rt ty uctxt
803804 = let ctxt = definitions uctxt
804805 access = case lookupDefAcc n False uctxt of
805806 [(_, acc)] -> acc
806807 _ -> Public
807− ctxt' = case (simpleCase tcase covering reflect CompileTime emptyFC inacc argtys ps_tot,
808− simpleCase tcase covering reflect CompileTime emptyFC inacc argtys ps_ct,
809− simpleCase tcase covering reflect CompileTime emptyFC inacc argtys ps_inl,
810− simpleCase tcase covering reflect RunTime emptyFC inacc argtys ps_rt) of
808+ ctxt' = case (simpleCase tcase covering reflect CompileTime emptyFC inacc argtys ps_tot ei,
809+ simpleCase tcase covering reflect CompileTime emptyFC inacc argtys ps_ct ei,
810+ simpleCase tcase covering reflect CompileTime emptyFC inacc argtys ps_inl ei,
811+ simpleCase tcase covering reflect RunTime emptyFC inacc argtys ps_rt ei) of
811812 (OK (CaseDef args_tot sc_tot _),
812813 OK (CaseDef args_ct sc_ct _),
813814 OK (CaseDef args_inl sc_inl _),
@@ -825,8 +826,8 @@ addCasedef n ci@(CaseInfo alwaysInline tcdict)
825826 uctxt { definitions = ctxt' }
826827
827828-- simplify a definition for totality checking
828−simplifyCasedef :: Name -> Context -> Context
829−simplifyCasedef n uctxt
829+simplifyCasedef :: Name -> ErasureInfo -> Context -> Context
830+simplifyCasedef n ei uctxt
830831 = let ctxt = definitions uctxt
831832 ctxt' = case lookupCtxt n ctxt of
832833 [(CaseOp ci ty atys [] ps _, acc, tot, metainf)] ->
@@ -834,7 +835,7 @@ simplifyCasedef n uctxt
834835 [(CaseOp ci ty atys ps_in ps cd, acc, tot, metainf)] ->
835836 let ps_in' = map simpl ps_in
836837 pdef = map debind ps_in' in
837− case simpleCase False True False CompileTime emptyFC [] atys pdef of
838+ case simpleCase False True False CompileTime emptyFC [] atys pdef ei of
838839 OK (CaseDef args sc _) ->
839840 addDef n (CaseOp ci
840841 ty atys ps_in' ps (cd { cases_totcheck = (args, sc) }),