@@ -788,7 +788,8 @@ addDatatype (Data n tag ty cons) uctxt
788 (TyDecl (DCon tag (arity ty')) ty, Public, Unchecked, EmptyMI) ctxt)
788 (TyDecl (DCon tag (arity ty')) ty, Public, Unchecked, EmptyMI) ctxt)
790-- FIXME: Too many arguments! Refactor all these Bools.
790-- 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 ->
792 [Type] -> -- argument types
793 [Type] -> -- argument types
793 [Int] -> -- inaccessible arguments
794 [Int] -> -- inaccessible arguments
794 [Either Term (Term, Term)] ->
795 [Either Term (Term, Term)] ->
@@ -797,17 +798,17 @@ addCasedef :: Name -> CaseInfo -> Bool -> Bool -> Bool -> Bool ->
797 [([Name], Term, Term)] -> -- inlined
798 [([Name], Term, Term)] -> -- inlined
798 [([Name], Term, Term)] -> -- run time
799 [([Name], Term, Term)] -> -- run time
799 Type -> Context -> Context
800 Type -> Context -> Context
800−addCasedef n ci@(CaseInfo alwaysInline tcdict)
801+addCasedef n ei ci@(CaseInfo alwaysInline tcdict)
801 tcase covering reflect asserted argtys inacc
802 tcase covering reflect asserted argtys inacc
802 ps_in ps_tot ps_inl ps_ct ps_rt ty uctxt
803 ps_in ps_tot ps_inl ps_ct ps_rt ty uctxt
803 = let ctxt = definitions uctxt
804 = let ctxt = definitions uctxt
804 access = case lookupDefAcc n False uctxt of
805 access = case lookupDefAcc n False uctxt of
805 [(_, acc)] -> acc
806 [(_, acc)] -> acc
806 _ -> Public
807 _ -> Public
807− ctxt' = case (simpleCase tcase covering reflect CompileTime emptyFC inacc argtys ps_tot,
808+ ctxt' = case (simpleCase tcase covering reflect CompileTime emptyFC inacc argtys ps_tot ei,
808− simpleCase tcase covering reflect CompileTime emptyFC inacc argtys ps_ct,
809+ simpleCase tcase covering reflect CompileTime emptyFC inacc argtys ps_ct ei,
809− simpleCase tcase covering reflect CompileTime emptyFC inacc argtys ps_inl,
810+ simpleCase tcase covering reflect CompileTime emptyFC inacc argtys ps_inl ei,
810− simpleCase tcase covering reflect RunTime emptyFC inacc argtys ps_rt) of
811+ simpleCase tcase covering reflect RunTime emptyFC inacc argtys ps_rt ei) of
811 (OK (CaseDef args_tot sc_tot _),
812 (OK (CaseDef args_tot sc_tot _),
812 OK (CaseDef args_ct sc_ct _),
813 OK (CaseDef args_ct sc_ct _),
813 OK (CaseDef args_inl sc_inl _),
814 OK (CaseDef args_inl sc_inl _),
@@ -825,8 +826,8 @@ addCasedef n ci@(CaseInfo alwaysInline tcdict)
825 uctxt { definitions = ctxt' }
826 uctxt { definitions = ctxt' }
827-- simplify a definition for totality checking
828-- simplify a definition for totality checking
828−simplifyCasedef :: Name -> Context -> Context
829+simplifyCasedef :: Name -> ErasureInfo -> Context -> Context
829−simplifyCasedef n uctxt
830+simplifyCasedef n ei uctxt
830 = let ctxt = definitions uctxt
831 = let ctxt = definitions uctxt
831 ctxt' = case lookupCtxt n ctxt of
832 ctxt' = case lookupCtxt n ctxt of
832 [(CaseOp ci ty atys [] ps _, acc, tot, metainf)] ->
833 [(CaseOp ci ty atys [] ps _, acc, tot, metainf)] ->
@@ -834,7 +835,7 @@ simplifyCasedef n uctxt
834 [(CaseOp ci ty atys ps_in ps cd, acc, tot, metainf)] ->
835 [(CaseOp ci ty atys ps_in ps cd, acc, tot, metainf)] ->
835 let ps_in' = map simpl ps_in
836 let ps_in' = map simpl ps_in
836 pdef = map debind ps_in' in
837 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
838 OK (CaseDef args sc _) ->
839 OK (CaseDef args sc _) ->
839 addDef n (CaseOp ci
840 addDef n (CaseOp ci
840 ty atys ps_in' ps (cd { cases_totcheck = (args, sc) }),
841 ty atys ps_in' ps (cd { cases_totcheck = (args, sc) }),