on master help sign in
Display totality errors on type check failure

Instead of only displaying them if there are no other errors, since totality errors can be the cause of other errors. Fixes #1437

commitbe0ab25f42e884a504d969b5552f16ae96daa8d7 authorEdwin Brady <ecb10@st-andrews.ac.uk> dateSun 14 Feb 2016, 17:24 (11 years ago) parentb81f30d
2 files changed+12−10
src/Idris/REPL.hs+10−9 test/meta002/AgdaStyleReflection.idr+2−1
src/Idris/REPL.hs+10−9
@@ -1620,15 +1620,16 @@ loadInputs inputs toline -- furthest line to read in input source files
16201620 let tidata = idris_tyinfodata inew
16211621 let patdefs = idris_patdefs inew
16221622 ok <- noErrors
1623− when ok $
1624− -- The $!! here prevents a space leak on reloading.
1625− -- This isn't a solution - but it's a temporary stopgap.
1626− -- See issue #2386
1627− do when (not keepstate) $ putIState $!! ist
1628− ist <- getIState
1629− putIState $!! ist { idris_tyinfodata = tidata,
1630− idris_patdefs = patdefs }
1631− tryLoad keepstate phase fs
1623+ if ok then
1624+ -- The $!! here prevents a space leak on reloading.
1625+ -- This isn't a solution - but it's a temporary stopgap.
1626+ -- See issue #2386
1627+ do when (not keepstate) $ putIState $!! ist
1628+ ist <- getIState
1629+ putIState $!! ist { idris_tyinfodata = tidata,
1630+ idris_patdefs = patdefs }
1631+ tryLoad keepstate phase fs
1632+ else warnTotality
16321633
16331634 ibc (IBC _ _) = True
16341635 ibc _ = False
test/meta002/AgdaStyleReflection.idr+2−1
@@ -71,7 +71,7 @@ implementation Quotable Term Raw where
7171 quote Ty = `(Ty)
7272
7373
74−implementation Show Term where
74+partial implementation Show Term where
7575 showPrec d (Var k xs) = showCon d "Var" $ showArg k ++ showArg xs
7676 showPrec d (Ctor n xs) = showCon d "Ctor" $ showArg n ++ showArg xs
7777 showPrec d (TyCtor n xs) = showCon d "TyCtor" $ showArg n ++ showArg xs
@@ -330,3 +330,4 @@ baz = tactic trivial
330330-- Local Variables:
331331-- idris-load-packages: ("pruviloj")
332332-- End:
333+