@@ -28,7 +28,9 @@ import Debug.Trace
2828
2929recheckC ctxt fc env t
3030 = 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)
33+ OK x -> return x
3234 addConstraints fc cs
3335 return (tm, ty)
3436
@@ -283,8 +285,8 @@ elabClauses info fc opts n_in cs = let n = liftname info n_in in
283285 tcase pcover pdef pdef' ty)
284286 addIBC (IBCDef n)
285287 setTotality n tot
286− if (tot == Unchecked) then totcheck (fc, n)
287− else addIBC (IBCTotal n tot)
288+ totcheck (fc, n)
289+ when (tot /= Unchecked) $ addIBC (IBCTotal n tot)
288290 i <- get
289291 case lookupDef Nothing n (tt_ctxt i) of
290292 (CaseOp _ _ _ _ sc _ _ : _) ->
@@ -320,7 +322,7 @@ elabVal info aspat tm_in
320322 logLvl 3 ("Value: " ++ show tm')
321323 let vtm = getInferTerm tm'
322324 logLvl 2 (show vtm)
323− recheckC ctxt (FC "prompt" 0) [] vtm
325+ recheckC ctxt (FC "(input)" 0) [] vtm
324326
325327-- checks if the clause is a possible left hand side. Returns the term if
326328-- possible, otherwise Nothing.
@@ -381,7 +383,7 @@ elabClause info tcgen (PClause fc fname lhs_in withs rhs_in whereblock)
381383 tclift $ elaborate ctxt (MN 0 "patRHS") clhsty []
382384 (do pbinds lhs_tm
383385 (_, _, is) <- erun fc (build i info False fname rhs)
384− psolve lhs_tm
386+ erun fc $ psolve lhs_tm
385387 tt <- get_term
386388 let (tm, ds) = runState (collectDeferred tt) []
387389 return (tm, ds, is))
@@ -436,7 +438,7 @@ elabClause info tcgen (PWith fc fname lhs_in withs wval_in withblock)
436438 (do pbinds lhs_tm
437439 -- TODO: may want where here - see winfo abpve
438440 (_', d, is) <- erun fc (build i info False fname (infTerm wval))
439− psolve lhs_tm
441+ erun fc $ psolve lhs_tm
440442 tt <- get_term
441443 return (tt, d, is))
442444 def' <- checkDef fc defer