@@ -28,7 +28,9 @@ import Debug.Trace
29recheckC ctxt fc env t
29recheckC ctxt fc env t
30 = do -- t' <- applyOpts (forget t) (doesn't work, or speed things up...)
30 = do -- t' <- applyOpts (forget t) (doesn't work, or speed things up...)
31− (tm, ty, cs) <- tclift $ recheck ctxt env (forget t) t
31+ (tm, ty, cs) <- tclift $ case recheck ctxt env (forget t) t of
32+ Error e -> tfail (At fc e)
32 addConstraints fc cs
34 addConstraints fc cs
33 return (tm, ty)
35 return (tm, ty)
@@ -283,8 +285,8 @@ elabClauses info fc opts n_in cs = let n = liftname info n_in in
283 tcase pcover pdef pdef' ty)
285 tcase pcover pdef pdef' ty)
284 addIBC (IBCDef n)
286 addIBC (IBCDef n)
285 setTotality n tot
287 setTotality n tot
286− if (tot == Unchecked) then totcheck (fc, n)
288+ totcheck (fc, n)
287− else addIBC (IBCTotal n tot)
289+ when (tot /= Unchecked) $ addIBC (IBCTotal n tot)
289 case lookupDef Nothing n (tt_ctxt i) of
291 case lookupDef Nothing n (tt_ctxt i) of
290 (CaseOp _ _ _ _ sc _ _ : _) ->
292 (CaseOp _ _ _ _ sc _ _ : _) ->
@@ -320,7 +322,7 @@ elabVal info aspat tm_in
320 logLvl 3 ("Value: " ++ show tm')
322 logLvl 3 ("Value: " ++ show tm')
321 let vtm = getInferTerm tm'
323 let vtm = getInferTerm tm'
322 logLvl 2 (show vtm)
324 logLvl 2 (show vtm)
323− recheckC ctxt (FC "prompt" 0) [] vtm
325+ recheckC ctxt (FC "(input)" 0) [] vtm
325-- checks if the clause is a possible left hand side. Returns the term if
327-- checks if the clause is a possible left hand side. Returns the term if
326-- possible, otherwise Nothing.
328-- possible, otherwise Nothing.
@@ -381,7 +383,7 @@ elabClause info tcgen (PClause fc fname lhs_in withs rhs_in whereblock)
381 tclift $ elaborate ctxt (MN 0 "patRHS") clhsty []
383 tclift $ elaborate ctxt (MN 0 "patRHS") clhsty []
382 (do pbinds lhs_tm
384 (do pbinds lhs_tm
383 (_, _, is) <- erun fc (build i info False fname rhs)
385 (_, _, is) <- erun fc (build i info False fname rhs)
384− psolve lhs_tm
386+ erun fc $ psolve lhs_tm
385 tt <- get_term
387 tt <- get_term
386 let (tm, ds) = runState (collectDeferred tt) []
388 let (tm, ds) = runState (collectDeferred tt) []
387 return (tm, ds, is))
389 return (tm, ds, is))
@@ -436,7 +438,7 @@ elabClause info tcgen (PWith fc fname lhs_in withs wval_in withblock)
436 (do pbinds lhs_tm
438 (do pbinds lhs_tm
437 -- TODO: may want where here - see winfo abpve
439 -- TODO: may want where here - see winfo abpve
438 (_', d, is) <- erun fc (build i info False fname (infTerm wval))
440 (_', d, is) <- erun fc (build i info False fname (infTerm wval))
439− psolve lhs_tm
441+ erun fc $ psolve lhs_tm
440 tt <- get_term
442 tt <- get_term
441 return (tt, d, is))
443 return (tt, d, is))
442 def' <- checkDef fc defer
444 def' <- checkDef fc defer