@@ -57,8 +57,9 @@ elabType info syn doc fc opts n ty' = {- let ty' = piBind (params info) ty_in
5757 ty' <- implicit syn n ty'
5858 let ty = addImpl i ty'
5959 logLvl 2 $ show n ++ " type " ++ showImp Nothing True False ty
60− ((tyT, defer, is), log) <- tclift $ elaborate ctxt n (TType (UVal 0)) []
61− (erun fc (build i info False n ty))
60+ ((tyT, defer, is), log) <-
61+ tclift $ elaborate ctxt n (TType (UVal 0)) []
62+ (errAt "type of " n (erun fc (build i info False n ty)))
6263 ds <- checkDef fc defer
6364 addDeferred ds
6465 mapM_ (elabCaseBlock info) is
@@ -139,8 +140,9 @@ elabData info syn doc fc codata (PDatadecl n t_in dcons)
139140 i <- getIState
140141 t_in <- implicit syn n t_in
141142 let t = addImpl i t_in
142− ((t', defer, is), log) <- tclift $ elaborate ctxt n (TType (UVal 0)) []
143− (erun fc (build i info False n t))
143+ ((t', defer, is), log) <-
144+ tclift $ elaborate ctxt n (TType (UVal 0)) []
145+ (errAt "data declaration " n (erun fc (build i info False n t)))
144146 def' <- checkDef fc defer
145147 addDeferredTyCon def'
146148 mapM_ (elabCaseBlock info) is
@@ -484,8 +486,9 @@ elabCon info syn tn codata (doc, n, t_in, fc)
484486 t_in <- implicit syn n (if codata then mkLazy t_in else t_in)
485487 let t = addImpl i t_in
486488 logLvl 2 $ show fc ++ ":Constructor " ++ show n ++ " : " ++ showImp Nothing True False t
487− ((t', defer, is), log) <- tclift $ elaborate ctxt n (TType (UVal 0)) []
488− (erun fc (build i info False n t))
489+ ((t', defer, is), log) <-
490+ tclift $ elaborate ctxt n (TType (UVal 0)) []
491+ (errAt "constructor " n (erun fc (build i info False n t)))
489492 logLvl 2 $ "Rechecking " ++ show t'
490493 def' <- checkDef fc defer
491494 addDeferred def'
@@ -800,7 +803,8 @@ elabClause info tcgen (cnum, PClause fc fname lhs_in withs rhs_in whereblock)
800803 logLvl 4 ("Fixed parameters: " ++ show params ++ " from " ++ show (fn_ty, fn_is))
801804 ((lhs', dlhs, []), _) <-
802805 tclift $ elaborate ctxt (MN 0 "patLHS") infP []
803− (erun fc (buildTC i info True tcgen fname (infTerm lhs)))
806+ (errAt "left hand side of " fname
807+ (erun fc (buildTC i info True tcgen fname (infTerm lhs))))
804808 let lhs_tm = orderPats (getInferTerm lhs')
805809 let lhs_ty = getInferType lhs'
806810 logLvl 3 ("Elaborated: " ++ show lhs_tm)
@@ -835,8 +839,10 @@ elabClause info tcgen (cnum, PClause fc fname lhs_in withs rhs_in whereblock)
835839 ((rhs', defer, is), _) <-
836840 tclift $ elaborate ctxt (MN 0 "patRHS") clhsty []
837841 (do pbinds lhs_tm
838− (_, _, is) <- erun fc (build i info False fname rhs)
839− erun fc $ psolve lhs_tm
842+ (_, _, is) <- errAt "right hand side of " fname
843+ (erun fc (build i info False fname rhs))
844+ errAt "right hand side of " fname
845+ (erun fc $ psolve lhs_tm)
840846 tt <- get_term
841847 let (tm, ds) = runState (collectDeferred tt) []
842848 return (tm, ds, is))
@@ -934,7 +940,8 @@ elabClause info tcgen (_, PWith fc fname lhs_in withs wval_in withblock)
934940 logLvl 5 ("LHS: " ++ showImp Nothing True False lhs)
935941 ((lhs', dlhs, []), _) <-
936942 tclift $ elaborate ctxt (MN 0 "patLHS") infP []
937− (erun fc (buildTC i info True tcgen fname (infTerm lhs)))
943+ (errAt "left hand side of with in " fname
944+ (erun fc (buildTC i info True tcgen fname (infTerm lhs))) )
938945 let lhs_tm = orderPats (getInferTerm lhs')
939946 let lhs_ty = getInferType lhs'
940947 let ret_ty = getRetTy lhs_ty
@@ -950,7 +957,8 @@ elabClause info tcgen (_, PWith fc fname lhs_in withs wval_in withblock)
950957 (bindTyArgs PVTy bargs infP) []
951958 (do pbinds lhs_tm
952959 -- TODO: may want where here - see winfo abpve
953− (_', d, is) <- erun fc (build i info False fname (infTerm wval))
960+ (_', d, is) <- errAt "with value in " fname
961+ (erun fc (build i info False fname (infTerm wval)))
954962 erun fc $ psolve lhs_tm
955963 tt <- get_term
956964 return (tt, d, is))