@@ -246,12 +246,11 @@ eval traceon ctxt ntimes genv tm opts = ev ntimes [] True [] tm where
246246 | not top && hnf = liftM (VP Ref n) (ev ntimes stk top env ty)
247247 | otherwise
248248 = do (u, ntimes) <- usable spec n ntimes_in
249− let red = u && (tcReducible n ctxt || spec || atRepl || runtime)
249+ let red = u && (tcReducible n ctxt || spec || atRepl || runtime
250+ || sUN "assert_total" `elem` stk)
250251 if red then
251252 do let val = lookupDefAcc n (spec || atRepl || runtime) ctxt
252253 case val of
253− [(Function _ tm, _)] | sUN "assert_total" `elem` stk ->
254− ev ntimes (n:stk) True env tm
255254 [(Function _ tm, Public)] ->
256255 ev ntimes (n:stk) True env tm
257256 [(TyDecl nt ty, _)] -> do vty <- ev ntimes stk True env ty
@@ -371,12 +370,13 @@ eval traceon ctxt ntimes genv tm opts = ev ntimes [] True [] tm where
371370 _ -> return $ unload env f args
372371 | otherwise
373372 = do (u, ntimes) <- usable spec n ntimes_in
374− let red = u && (tcReducible n ctxt || spec || atRepl || runtime)
373+ let red = u && (tcReducible n ctxt || spec || atRepl || runtime
374+ || sUN "assert_total" `elem` stk)
375375 if red then
376376 do let val = lookupDefAcc n (spec || atRepl || runtime) ctxt
377377 case val of
378378 [(CaseOp ci _ _ _ _ cd, acc)]
379− | acc == Public || acc == Hidden || sUN "assert_total" `elem` stk ->
379+ | acc == Public || acc == Hidden ->
380380 -- unoptimised version
381381 let (ns, tree) = getCases cd in
382382 if blockSimplify ci n stk
@@ -1094,7 +1094,7 @@ lookupTotalExact n ctxt = fmap mkt $ lookupCtxtExact n (definitions ctxt)
10941094-- are not reducible (so treated as a constant)
10951095tcReducible :: Name -> Context -> Bool
10961096tcReducible n ctxt = case lookupTotalExact n ctxt of
1097− Nothing -> False
1097+ Nothing -> True
10981098 Just (Partial _) -> False
10991099 _ -> True
11001100