@@ -1010,6 +1010,8 @@ elabClause info opts (_, PWith fc fname lhs_in withs wval_in withblock)
1010 wb <- mapM (mkAuxC wname lhs (map fst bargs_pre) (map fst bargs_post))
1010 wb <- mapM (mkAuxC wname lhs (map fst bargs_pre) (map fst bargs_post))
1011 withblock
1011 withblock
1012 logLvl 3 ("with block " ++ show wb)
1012 logLvl 3 ("with block " ++ show wb)
1013+ -- propagate totality assertion to the new definitions
1014+ when (AssertTotal `elem` opts) $ setFlags wname [AssertTotal]
1013 mapM_ (elabDecl EAll info) wb
1015 mapM_ (elabDecl EAll info) wb
1015 -- rhs becomes: fname' ps wval
1017 -- rhs becomes: fname' ps wval
@@ -1501,6 +1503,9 @@ elabDecl' what info (PMutual f ps)
1501 mapM_ (elabDecl EDefns info) ps
1503 mapM_ (elabDecl EDefns info) ps
1502 -- Do totality checking after entire mutual block
1504 -- Do totality checking after entire mutual block
1503 i <- get
1505 i <- get
1506+ mapM_ (\n -> do logLvl 5 $ "Simplifying " ++ show n
1507+ updateContext (simplifyCasedef n))
1508+ (map snd (idris_totcheck i))
1504 mapM_ buildSCG (idris_totcheck i)
1509 mapM_ buildSCG (idris_totcheck i)
1505 mapM_ checkDeclTotality (idris_totcheck i)
1510 mapM_ checkDeclTotality (idris_totcheck i)
1506 clear_totcheck
1511 clear_totcheck