@@ -615,10 +615,12 @@ instance Show Def where
615615 show (Function ty tm) = "Function: " ++ show (ty, tm)
616616 show (TyDecl nt ty) = "TyDecl: " ++ show nt ++ " " ++ show ty
617617 show (Operator ty _ _) = "Operator: " ++ show ty
618− show (CaseOp _ _ ty ps_in ps ns sc ns' sc')
618+ show (CaseOp inlc inlr ty ps_in ps ns sc ns' sc')
619619 = "Case: " ++ show ty ++ " " ++ show ps ++ "\n" ++
620620 show ns ++ " " ++ show sc ++ "\n" ++
621− show ns' ++ " " ++ show sc'
621+ show ns' ++ " " ++ show sc' ++ "\n" ++
622+ if inlc then "Inlinable\n" else "Not inlinable\n"
623+
622624-- We need this for serialising Def. Fortunately, it never gets used because
623625-- we'll never serialise a primitive operator
624626
@@ -725,12 +727,12 @@ addDatatype (Data n tag ty cons) uctxt
725727 addCons (tag+1) cons (addDef n
726728 (TyDecl (DCon tag (arity ty')) ty, Public, Unchecked) ctxt)
727729
728−addCasedef :: Name -> Bool -> Bool -> Bool ->
730+addCasedef :: Name -> Bool -> Bool -> Bool -> Bool ->
729731 [Either Term (Term, Term)] ->
730732 [([Name], Term, Term)] ->
731733 [([Name], Term, Term)] ->
732734 Type -> Context -> Context
733−addCasedef n alwaysInline tcase covering ps_in ps psrt ty uctxt
735+addCasedef n alwaysInline tcase covering asserted ps_in ps psrt ty uctxt
734736 = let ctxt = definitions uctxt
735737 access = case lookupDefAcc Nothing n False uctxt of
736738 [(_, acc)] -> acc
@@ -738,8 +740,10 @@ addCasedef n alwaysInline tcase covering ps_in ps psrt ty uctxt
738740 ctxt' = case (simpleCase tcase covering CompileTime (FC "" 0) ps,
739741 simpleCase tcase covering RunTime (FC "" 0) psrt) of
740742 (OK (CaseDef args sc _), OK (CaseDef args' sc' _)) ->
741− let inl = alwaysInline in
742− addDef n (CaseOp inl (inl || small n args sc')
743+ let inl = alwaysInline
744+ inlc = (inl || small n args sc') && (not asserted)
745+ inlr = inl || small n args sc' in
746+ addDef n (CaseOp inlc inlr
743747 ty ps_in ps args sc args' sc',
744748 access, Unchecked) ctxt in
745749 uctxt { definitions = ctxt' }