@@ -42,7 +42,7 @@ elabType info syn fc n ty' = {- let ty' = piBind (params info) ty_in
42 let ty = addImpl i ty'
42 let ty = addImpl i ty'
43 logLvl 2 $ show n ++ " type " ++ showImp True ty
43 logLvl 2 $ show n ++ " type " ++ showImp True ty
44 ((ty', defer), log) <- tclift $ elaborate ctxt n (Set (UVal 0))
44 ((ty', defer), log) <- tclift $ elaborate ctxt n (Set (UVal 0))
45− (erun fc (build i info False ty))
45+ (erun fc (build i info False n ty))
46 (cty, _) <- recheckC ctxt fc [] ty'
46 (cty, _) <- recheckC ctxt fc [] ty'
47 logLvl 2 $ "---> " ++ show cty
47 logLvl 2 $ "---> " ++ show cty
48 let nty = normalise ctxt [] cty
48 let nty = normalise ctxt [] cty
@@ -59,7 +59,7 @@ elabData info syn fc (PDatadecl n t_in dcons)
59 t_in <- implicit syn n t_in
59 t_in <- implicit syn n t_in
60 let t = addImpl i t_in
60 let t = addImpl i t_in
61 ((t', defer), log) <- tclift $ elaborate ctxt n (Set (UVal 0))
61 ((t', defer), log) <- tclift $ elaborate ctxt n (Set (UVal 0))
62− (erun fc (build i info False t))
62+ (erun fc (build i info False n t))
63 def' <- checkDef fc defer
63 def' <- checkDef fc defer
64 addDeferred def'
64 addDeferred def'
65 (cty, _) <- recheckC ctxt fc [] t'
65 (cty, _) <- recheckC ctxt fc [] t'
@@ -79,7 +79,7 @@ elabCon info syn (n, t_in, fc)
79 let t = addImpl i t_in
79 let t = addImpl i t_in
80 logLvl 2 $ show fc ++ ":Constructor " ++ show n ++ " : " ++ showImp True t
80 logLvl 2 $ show fc ++ ":Constructor " ++ show n ++ " : " ++ showImp True t
81 ((t', defer), log) <- tclift $ elaborate ctxt n (Set (UVal 0))
81 ((t', defer), log) <- tclift $ elaborate ctxt n (Set (UVal 0))
82− (erun fc (build i info False t))
82+ (erun fc (build i info False n t))
83 logLvl 2 $ "Rechecking " ++ show t'
83 logLvl 2 $ "Rechecking " ++ show t'
84 def' <- checkDef fc defer
84 def' <- checkDef fc defer
85 addDeferred def'
85 addDeferred def'
@@ -129,7 +129,7 @@ elabVal info aspat tm_in
129 let tm = addImpl i tm_in
129 let tm = addImpl i tm_in
130 logLvl 10 (showImp True tm)
130 logLvl 10 (showImp True tm)
131 ((tm', defer), _) <- tclift $ elaborate ctxt (MN 0 "val") infP
131 ((tm', defer), _) <- tclift $ elaborate ctxt (MN 0 "val") infP
132− (build i info aspat (infTerm tm))
132+ (build i info aspat (MN 0 "val") (infTerm tm))
133 logLvl 3 ("Value: " ++ show tm')
133 logLvl 3 ("Value: " ++ show tm')
134 let vtm = getInferTerm tm'
134 let vtm = getInferTerm tm'
135 logLvl 2 (show vtm)
135 logLvl 2 (show vtm)
@@ -142,7 +142,7 @@ elabClause info fc (PClause fname lhs_in [] PImpossible [])
142 let lhs = addImpl i lhs_in
142 let lhs = addImpl i lhs_in
143 -- if the LHS type checks, it is possible, so report an error
143 -- if the LHS type checks, it is possible, so report an error
144 case elaborate ctxt (MN 0 "patLHS") infP
144 case elaborate ctxt (MN 0 "patLHS") infP
145− (erun fc (build i info True (infTerm lhs))) of
145+ (erun fc (build i info True fname (infTerm lhs))) of
146 OK _ -> fail $ show fc ++ ":" ++ show lhs ++ " is a possible case"
146 OK _ -> fail $ show fc ++ ":" ++ show lhs ++ " is a possible case"
147 Error _ -> return ()
147 Error _ -> return ()
148 return Nothing
148 return Nothing
@@ -154,7 +154,7 @@ elabClause info fc (PClause fname lhs_in withs rhs_in whereblock)
154 let lhs = addImpl i lhs_in
154 let lhs = addImpl i lhs_in
155 logLvl 5 ("LHS: " ++ showImp True lhs)
155 logLvl 5 ("LHS: " ++ showImp True lhs)
156 ((lhs', dlhs), _) <- tclift $ elaborate ctxt (MN 0 "patLHS") infP
156 ((lhs', dlhs), _) <- tclift $ elaborate ctxt (MN 0 "patLHS") infP
157− (erun fc (build i info True (infTerm lhs)))
157+ (erun fc (build i info True fname (infTerm lhs)))
158 let lhs_tm = orderPats (getInferTerm lhs')
158 let lhs_tm = orderPats (getInferTerm lhs')
159 let lhs_ty = getInferType lhs'
159 let lhs_ty = getInferType lhs'
160 logLvl 3 (show lhs_tm)
160 logLvl 3 (show lhs_tm)
@@ -179,7 +179,7 @@ elabClause info fc (PClause fname lhs_in withs rhs_in whereblock)
179 ((rhs', defer), _) <-
179 ((rhs', defer), _) <-
180 tclift $ elaborate ctxt (MN 0 "patRHS") clhsty
180 tclift $ elaborate ctxt (MN 0 "patRHS") clhsty
181 (do pbinds lhs_tm
181 (do pbinds lhs_tm
182− (_, _) <- erun fc (build i info False rhs)
182+ (_, _) <- erun fc (build i info False fname rhs)
183 psolve lhs_tm
183 psolve lhs_tm
184 tt <- get_term
184 tt <- get_term
185 return $ runState (collectDeferred tt) [])
185 return $ runState (collectDeferred tt) [])
@@ -213,7 +213,7 @@ elabClause info fc (PWith fname lhs_in withs wval_in withblock)
213 let lhs = addImpl i lhs_in
213 let lhs = addImpl i lhs_in
214 logLvl 5 ("LHS: " ++ showImp True lhs)
214 logLvl 5 ("LHS: " ++ showImp True lhs)
215 ((lhs', dlhs), _) <- tclift $ elaborate ctxt (MN 0 "patLHS") infP
215 ((lhs', dlhs), _) <- tclift $ elaborate ctxt (MN 0 "patLHS") infP
216− (erun fc (build i info True (infTerm lhs)))
216+ (erun fc (build i info True fname (infTerm lhs)))
217 let lhs_tm = orderPats (getInferTerm lhs')
217 let lhs_tm = orderPats (getInferTerm lhs')
218 let lhs_ty = getInferType lhs'
218 let lhs_ty = getInferType lhs'
219 let ret_ty = getRetTy lhs_ty
219 let ret_ty = getRetTy lhs_ty
@@ -229,7 +229,7 @@ elabClause info fc (PWith fname lhs_in withs wval_in withblock)
229 (bindTyArgs PVTy bargs infP)
229 (bindTyArgs PVTy bargs infP)
230 (do pbinds lhs_tm
230 (do pbinds lhs_tm
231 -- TODO: may want where here - see winfo abpve
231 -- TODO: may want where here - see winfo abpve
232− (_', d) <- erun fc (build i info False (infTerm wval))
232+ (_', d) <- erun fc (build i info False fname (infTerm wval))
233 psolve lhs_tm
233 psolve lhs_tm
234 tt <- get_term
234 tt <- get_term
235 return (tt, d))
235 return (tt, d))
@@ -264,7 +264,7 @@ elabClause info fc (PWith fname lhs_in withs wval_in withblock)
264 ((rhs', defer), _) <-
264 ((rhs', defer), _) <-
265 tclift $ elaborate ctxt (MN 0 "wpatRHS") clhsty
265 tclift $ elaborate ctxt (MN 0 "wpatRHS") clhsty
266 (do pbinds lhs_tm
266 (do pbinds lhs_tm
267− (_, d) <- erun fc (build i info False rhs)
267+ (_, d) <- erun fc (build i info False fname rhs)
268 psolve lhs_tm
268 psolve lhs_tm
269 tt <- get_term
269 tt <- get_term
270 return (tt, d))
270 return (tt, d))