@@ -442,12 +442,18 @@ checkDeclTotality (fc, n)
442442 _ -> []
443443 when (CoveringFn `elem` opts) $ checkAllCovering fc [] n n
444444 t <- checkTotality [] fc n
445+ let acc = case lookupDefAccExact n False (tt_ctxt i) of
446+ Just (n, a) -> a
447+ _ -> Public
445448 case t of
446449 -- if it's not total, it can't reduce, to keep
447− -- typechecking decidable
448− p@(Partial _) -> do setAccessibility n Frozen
449− addIBC (IBCAccess n Frozen)
450− logCoverage 5 $ "HIDDEN: "
450+ -- typechecking decidable.
451+ -- So if it's currently public export, set it as
452+ -- export instead.
453+ p@(Partial _) -> do let newacc = max Frozen acc
454+ setAccessibility n newacc
455+ addIBC (IBCAccess n newacc)
456+ logCoverage 5 $ "Set to " ++ show newacc ++ ":"
451457 ++ show n ++ show p
452458 _ -> return ()
453459 return t