@@ -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