@@ -159,7 +159,7 @@ elabRecord info syn fc tyn ty cn cty
159159 let lhs = PApp fc (PRef fc pn)
160160 [pexp (PApp fc (PRef fc cn) iargs)]
161161 let rhs = PRef fc (mkp pn)
162− let pclause = PClause pn lhs [] rhs []
162+ let pclause = PClause fc pn lhs [] rhs []
163163 return [pfnTy, PClauses fc [] pn [pclause]]
164164
165165 implicitise (pa, t) = pa { getTm = t }
@@ -175,7 +175,7 @@ elabRecord info syn fc tyn ty cn cty
175175 let rhsArgs = take pos pls ++ (PRef fc valname) :
176176 drop (pos + 1) pls
177177 let before = pos
178− let pclause = PClause setname (PApp fc (PRef fc setname)
178+ let pclause = PClause fc setname (PApp fc (PRef fc setname)
179179 [pexp (PRef fc valname),
180180 pexp (PApp fc (PRef fc cn)
181181 (map pexp lhsArgs))])
@@ -214,7 +214,7 @@ elabCon info syn tn (n, t_in, fc)
214214
215215elabClauses :: ElabInfo -> FC -> FnOpts -> Name -> [PClause] -> Idris ()
216216elabClauses info fc opts n_in cs = let n = liftname info n_in in
217− do pats_in <- mapM (elabClause info fc (TCGen `elem` opts)) cs
217+ do pats_in <- mapM (elabClause info (TCGen `elem` opts)) cs
218218 solveDeferred n
219219 let pats = mapMaybe id pats_in
220220 logLvl 3 (showSep "\n" (map (\ (l,r) ->
@@ -340,19 +340,19 @@ checkPossible info fc tcgen fname lhs_in
340340-- trace (show (delab' i lhs_tm True) ++ "\n" ++ show lhs) $ return (not b)
341341 Error _ -> return False
342342
343−elabClause :: ElabInfo -> FC -> Bool -> PClause -> Idris (Maybe (Term, Term))
344−elabClause info fc tcgen (PClause fname lhs_in [] PImpossible [])
343+elabClause :: ElabInfo -> Bool -> PClause -> Idris (Maybe (Term, Term))
344+elabClause info tcgen (PClause fc fname lhs_in [] PImpossible [])
345345 = do b <- checkPossible info fc tcgen fname lhs_in
346346 case b of
347347 True -> fail $ show fc ++ ":" ++ show lhs_in ++ " is a possible case"
348348 False -> return Nothing
349−elabClause info fc tcgen (PClause fname lhs_in withs rhs_in whereblock)
349+elabClause info tcgen (PClause fc fname lhs_in withs rhs_in whereblock)
350350 = do ctxt <- getContext
351351 -- Build the LHS as an "Infer", and pull out its type and
352352 -- pattern bindings
353353 i <- get
354354 let lhs = addImplPat i lhs_in
355− logLvl 5 ("LHS: " ++ showImp True lhs)
355+ logLvl 5 ("LHS: " ++ show fc ++ " " ++ showImp True lhs)
356356 ((lhs', dlhs, []), _) <-
357357 tclift $ elaborate ctxt (MN 0 "patLHS") infP []
358358 (erun fc (buildTC i info True tcgen fname (infTerm lhs)))
@@ -411,7 +411,7 @@ elabClause info fc tcgen (PClause fname lhs_in withs rhs_in whereblock)
411411 -- _ -> MN i (show n)) . l
412412 }
413413
414−elabClause info fc tcgen (PWith fname lhs_in withs wval_in withblock)
414+elabClause info tcgen (PWith fc fname lhs_in withs wval_in withblock)
415415 = do ctxt <- getContext
416416 -- Build the LHS as an "Infer", and pull out its type and
417417 -- pattern bindings
@@ -491,7 +491,7 @@ elabClause info fc tcgen (PWith fname lhs_in withs wval_in withblock)
491491 | otherwise = fail $ show fc ++ "with clause uses wrong function name " ++ show n
492492 mkAuxC wname lhs ns d = return $ d
493493
494− mkAux wname toplhs ns (PClause n tm_in (w:ws) rhs wheres)
494+ mkAux wname toplhs ns (PClause fc n tm_in (w:ws) rhs wheres)
495495 = do i <- get
496496 let tm = addImpl i tm_in
497497 logLvl 2 ("Matching " ++ showImp True tm ++ " against " ++
@@ -500,8 +500,8 @@ elabClause info fc tcgen (PWith fname lhs_in withs wval_in withblock)
500500 Left _ -> fail $ show fc ++ "with clause does not match top level"
501501 Right mvars -> do logLvl 3 ("Match vars : " ++ show mvars)
502502 lhs <- updateLHS n wname mvars ns (fullApp tm) w
503− return $ PClause wname lhs ws rhs wheres
504− mkAux wname toplhs ns (PWith n tm_in (w:ws) wval withs)
503+ return $ PClause fc wname lhs ws rhs wheres
504+ mkAux wname toplhs ns (PWith fc n tm_in (w:ws) wval withs)
505505 = do i <- get
506506 let tm = addImpl i tm_in
507507 logLvl 2 ("Matching " ++ showImp True tm ++ " against " ++
@@ -510,7 +510,7 @@ elabClause info fc tcgen (PWith fname lhs_in withs wval_in withblock)
510510 case matchClause i toplhs tm of
511511 Left _ -> fail $ show fc ++ "with clause does not match top level"
512512 Right mvars -> do lhs <- updateLHS n wname mvars ns (fullApp tm) w
513− return $ PWith wname lhs ws wval withs'
513+ return $ PWith fc wname lhs ws wval withs'
514514
515515 updateLHS n wname mvars ns (PApp fc (PRef fc' n') args) w
516516 = return $ substMatches mvars $
@@ -597,7 +597,7 @@ elabClass info syn fc constraints tn ps ds
597597 iLOG (showImp True ty)
598598 iLOG (showImp True lhs ++ " = " ++ showImp True rhs)
599599 return [PTy syn fc [] cfn ty,
600− PClauses fc [Inlinable,TCGen] cfn [PClause cfn lhs [] rhs []]]
600+ PClauses fc [Inlinable,TCGen] cfn [PClause fc cfn lhs [] rhs []]]
601601
602602 tfun cn c syn all (m, (o, ty))
603603 = do let ty' = insertConstraint c ty
@@ -611,7 +611,7 @@ elabClass info syn fc constraints tn ps ds
611611 iLOG (show (m, ty', capp, margs))
612612 iLOG (showImp True lhs ++ " = " ++ showImp True rhs)
613613 return [PTy syn fc o m ty',
614− PClauses fc [Inlinable,TCGen] m [PClause m lhs [] rhs []]]
614+ PClauses fc [Inlinable,TCGen] m [PClause fc m lhs [] rhs []]]
615615
616616 getMArgs (PPi (Imp _ _) n ty sc) = IA : getMArgs sc
617617 getMArgs (PPi (Exp _ _) n ty sc) = EA : getMArgs sc
@@ -649,7 +649,7 @@ elabInstance info syn fc cs n ps t ds
649649 = do i <- get
650650 (n, ci) <- case lookupCtxtName (namespace info) n (idris_classes i) of
651651 [c] -> return c
652− _ -> fail $ show n ++ " is not a type class"
652+ _ -> fail $ show fc ++ ":" ++ show n ++ " is not a type class"
653653 let iname = UN ('@':show n ++ "$" ++ show ps)
654654 elabType info syn fc [] iname t
655655 let ips = zip (class_params ci) ps
@@ -678,7 +678,7 @@ elabInstance info syn fc cs n ps t ds
678678 let rhs = PApp fc (PRef fc (instanceName ci))
679679 (map (pexp . mkMethApp) mtys)
680680 let idecl = PClauses fc [Inlinable, TCGen] iname
681− [PClause iname lhs [] rhs wb]
681+ [PClause fc iname lhs [] rhs wb]
682682 iLOG (show idecl)
683683 elabDecl info idecl
684684 where
@@ -727,8 +727,8 @@ elabInstance info syn fc cs n ps t ds
727727 insertDef meth def ns decls
728728 | null $ filter (clauseFor meth ns) decls
729729 = decls ++ [PClauses fc [Inlinable,TCGen] meth
730− [PClause meth (PApp fc (PRef fc meth) []) []
731− (PApp fc (PRef fc def) []) []]]
730+ [PClause fc meth (PApp fc (PRef fc meth) []) []
731+ (PApp fc (PRef fc def) []) []]]
732732 | otherwise = decls
733733
734734 warnMissing decls ns meth
@@ -742,8 +742,8 @@ elabInstance info syn fc cs n ps t ds
742742decorateid decorate (PTy s f o n t) = PTy s f o (decorate n) t
743743decorateid decorate (PClauses f o n cs)
744744 = PClauses f o (decorate n) (map dc cs)
745− where dc (PClause n t as w ds) = PClause (decorate n) (dappname t) as w ds
746− dc (PWith n t as w ds) = PWith (decorate n) (dappname t) as w
745+ where dc (PClause fc n t as w ds) = PClause fc (decorate n) (dappname t) as w ds
746+ dc (PWith fc n t as w ds) = PWith fc (decorate n) (dappname t) as w
747747 (map (decorateid decorate) ds)
748748 dappname (PApp fc (PRef fc' n) as) = PApp fc (PRef fc' (decorate n)) as
749749 dappname t = t