@@ -1519,9 +1519,9 @@ addImpl' inpat env infns imp_meths ist ptm
15191519 ai :: Bool -> [(Name, Maybe PTerm)] -> [[T.Text]] -> PTerm -> PTerm
15201520 ai qq env ds (PRef fc f)
15211521 | f `elem` infns = PInferRef fc f
1522− | not (f `elem` map fst env) = handleErr $ aiFn inpat inpat qq imp_meths ist fc f ds []
1522+ | not (f `elem` map fst env) = handleErr $ aiFn inpat inpat qq imp_meths ist fc f fc ds []
15231523 ai qq env ds (PHidden (PRef fc f))
1524− | not (f `elem` map fst env) = PHidden (handleErr $ aiFn inpat False qq imp_meths ist fc f ds [])
1524+ | not (f `elem` map fst env) = PHidden (handleErr $ aiFn inpat False qq imp_meths ist fc f fc ds [])
15251525 ai qq env ds (PEq fc lt rt l r)
15261526 = let lt' = ai qq env ds lt
15271527 rt' = ai qq env ds rt
@@ -1553,11 +1553,11 @@ addImpl' inpat env infns imp_meths ist ptm
15531553 ai qq env ds (PApp fc (PInferRef _ f) as)
15541554 = let as' = map (fmap (ai qq env ds)) as in
15551555 PApp fc (PInferRef fc f) as'
1556− ai qq env ds (PApp fc ftm@(PRef _ f) as)
1557− | f `elem` infns = ai qq env ds (PApp fc (PInferRef fc f) as)
1556+ ai qq env ds (PApp fc ftm@(PRef ffc f) as)
1557+ | f `elem` infns = ai qq env ds (PApp fc (PInferRef ffc f) as)
15581558 | not (f `elem` map fst env)
15591559 = let as' = map (fmap (ai qq env ds)) as in
1560− handleErr $ aiFn inpat False qq imp_meths ist fc f ds as'
1560+ handleErr $ aiFn inpat False qq imp_meths ist fc f ffc ds as'
15611561 | Just (Just ty) <- lookup f env =
15621562 let as' = map (fmap (ai qq env ds)) as
15631563 arity = getPArity ty in
@@ -1621,8 +1621,8 @@ addImpl' inpat env infns imp_meths ist ptm
16211621-- if in a pattern, and there are no arguments, and there's no possible
16221622-- names with zero explicit arguments, don't add implicits.
16231623
1624−aiFn :: Bool -> Bool -> Bool -> [Name] -> IState -> FC -> Name -> [[T.Text]] -> [PArg] -> Either Err PTerm
1625−aiFn inpat True qq imp_meths ist fc f ds []
1624+aiFn :: Bool -> Bool -> Bool -> [Name] -> IState -> FC -> Name -> FC -> [[T.Text]] -> [PArg] -> Either Err PTerm
1625+aiFn inpat True qq imp_meths ist fc f ffc ds []
16261626 = case lookupDef f (tt_ctxt ist) of
16271627 [] -> Right $ PPatvar fc f
16281628 alts -> let ialts = lookupCtxtName f (idris_implicits ist) in
@@ -1630,7 +1630,7 @@ aiFn inpat True qq imp_meths ist fc f ds []
16301630 if (not (vname f) || tcname f
16311631 || any (conCaf (tt_ctxt ist)) ialts)
16321632-- any constructor alts || any allImp ialts))
1633− then aiFn inpat False qq imp_meths ist fc f ds [] -- use it as a constructor
1633+ then aiFn inpat False qq imp_meths ist fc f fc ds [] -- use it as a constructor
16341634 else Right $ PPatvar fc f
16351635 where imp (PExp _ _ _ _) = False
16361636 imp _ = True
@@ -1644,9 +1644,9 @@ aiFn inpat True qq imp_meths ist fc f ds []
16441644 vname (UN n) = True -- non qualified
16451645 vname _ = False
16461646
1647−aiFn inpat expat qq imp_meths ist fc f ds as
1648− | f `elem` primNames = Right $ PApp fc (PRef fc f) as
1649−aiFn inpat expat qq imp_meths ist fc f ds as
1647+aiFn inpat expat qq imp_meths ist fc f ffc ds as
1648+ | f `elem` primNames = Right $ PApp fc (PRef ffc f) as
1649+aiFn inpat expat qq imp_meths ist fc f ffc ds as
16501650 -- This is where namespaces get resolved by adding PAlternative
16511651 = do let ns = lookupCtxtName f (idris_implicits ist)
16521652 let nh = filter (\(n, _) -> notHidden n) ns
@@ -1654,13 +1654,13 @@ aiFn inpat expat qq imp_meths ist fc f ds as
16541654 [] -> nh
16551655 x -> x
16561656 case ns' of
1657− [(f',ns)] -> Right $ mkPApp fc (length ns) (PRef fc (isImpName f f')) (insertImpl ns as)
1657+ [(f',ns)] -> Right $ mkPApp fc (length ns) (PRef ffc (isImpName f f')) (insertImpl ns as)
16581658 [] -> if f `elem` (map fst (idris_metavars ist))
1659− then Right $ PApp fc (PRef fc f) as
1660− else Right $ mkPApp fc (length as) (PRef fc f) as
1659+ then Right $ PApp fc (PRef ffc f) as
1660+ else Right $ mkPApp fc (length as) (PRef ffc f) as
16611661 alts -> Right $
16621662 PAlternative True $
1663− map (\(f', ns) -> mkPApp fc (length ns) (PRef fc (isImpName f f'))
1663+ map (\(f', ns) -> mkPApp fc (length ns) (PRef ffc (isImpName f f'))
16641664 (insertImpl ns as)) alts
16651665 where
16661666 -- if the name is in imp_meths, we should actually refer to the bound