@@ -1519,9 +1519,9 @@ addImpl' inpat env infns imp_meths ist ptm
1519 ai :: Bool -> [(Name, Maybe PTerm)] -> [[T.Text]] -> PTerm -> PTerm
1519 ai :: Bool -> [(Name, Maybe PTerm)] -> [[T.Text]] -> PTerm -> PTerm
1520 ai qq env ds (PRef fc f)
1520 ai qq env ds (PRef fc f)
1521 | f `elem` infns = PInferRef fc f
1521 | 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 []
1523 ai qq env ds (PHidden (PRef fc f))
1523 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 [])
1525 ai qq env ds (PEq fc lt rt l r)
1525 ai qq env ds (PEq fc lt rt l r)
1526 = let lt' = ai qq env ds lt
1526 = let lt' = ai qq env ds lt
1527 rt' = ai qq env ds rt
1527 rt' = ai qq env ds rt
@@ -1553,11 +1553,11 @@ addImpl' inpat env infns imp_meths ist ptm
1553 ai qq env ds (PApp fc (PInferRef _ f) as)
1553 ai qq env ds (PApp fc (PInferRef _ f) as)
1554 = let as' = map (fmap (ai qq env ds)) as in
1554 = let as' = map (fmap (ai qq env ds)) as in
1555 PApp fc (PInferRef fc f) as'
1555 PApp fc (PInferRef fc f) as'
1556− ai qq env ds (PApp fc ftm@(PRef _ 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 fc f) as)
1557+ | f `elem` infns = ai qq env ds (PApp fc (PInferRef ffc f) as)
1558 | not (f `elem` map fst env)
1558 | not (f `elem` map fst env)
1559 = let as' = map (fmap (ai qq env ds)) as in
1559 = 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'
1561 | Just (Just ty) <- lookup f env =
1561 | Just (Just ty) <- lookup f env =
1562 let as' = map (fmap (ai qq env ds)) as
1562 let as' = map (fmap (ai qq env ds)) as
1563 arity = getPArity ty in
1563 arity = getPArity ty in
@@ -1621,8 +1621,8 @@ addImpl' inpat env infns imp_meths ist ptm
1621-- if in a pattern, and there are no arguments, and there's no possible
1621-- if in a pattern, and there are no arguments, and there's no possible
1622-- names with zero explicit arguments, don't add implicits.
1622-- names with zero explicit arguments, don't add implicits.
1624−aiFn :: Bool -> Bool -> Bool -> [Name] -> IState -> FC -> Name -> [[T.Text]] -> [PArg] -> Either Err PTerm
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 ds []
1625+aiFn inpat True qq imp_meths ist fc f ffc ds []
1626 = case lookupDef f (tt_ctxt ist) of
1626 = case lookupDef f (tt_ctxt ist) of
1627 [] -> Right $ PPatvar fc f
1627 [] -> Right $ PPatvar fc f
1628 alts -> let ialts = lookupCtxtName f (idris_implicits ist) in
1628 alts -> let ialts = lookupCtxtName f (idris_implicits ist) in
@@ -1630,7 +1630,7 @@ aiFn inpat True qq imp_meths ist fc f ds []
1630 if (not (vname f) || tcname f
1630 if (not (vname f) || tcname f
1631 || any (conCaf (tt_ctxt ist)) ialts)
1631 || any (conCaf (tt_ctxt ist)) ialts)
1632-- any constructor alts || any allImp ialts))
1632-- 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
1634 else Right $ PPatvar fc f
1634 else Right $ PPatvar fc f
1635 where imp (PExp _ _ _ _) = False
1635 where imp (PExp _ _ _ _) = False
1636 imp _ = True
1636 imp _ = True
@@ -1644,9 +1644,9 @@ aiFn inpat True qq imp_meths ist fc f ds []
1644 vname (UN n) = True -- non qualified
1644 vname (UN n) = True -- non qualified
1645 vname _ = False
1645 vname _ = False
1647−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 fc f) as
1648+ | f `elem` primNames = Right $ PApp fc (PRef ffc f) as
1649−aiFn inpat expat qq imp_meths ist fc f ds as
1649+aiFn inpat expat qq imp_meths ist fc f ffc ds as
1650 -- This is where namespaces get resolved by adding PAlternative
1650 -- This is where namespaces get resolved by adding PAlternative
1651 = do let ns = lookupCtxtName f (idris_implicits ist)
1651 = do let ns = lookupCtxtName f (idris_implicits ist)
1652 let nh = filter (\(n, _) -> notHidden n) ns
1652 let nh = filter (\(n, _) -> notHidden n) ns
@@ -1654,13 +1654,13 @@ aiFn inpat expat qq imp_meths ist fc f ds as
1654 [] -> nh
1654 [] -> nh
1656 case ns' of
1656 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)
1658 [] -> if f `elem` (map fst (idris_metavars ist))
1658 [] -> if f `elem` (map fst (idris_metavars ist))
1659− then Right $ PApp fc (PRef fc f) as
1659+ then Right $ PApp fc (PRef ffc f) as
1660− else Right $ mkPApp fc (length as) (PRef fc f) as
1660+ else Right $ mkPApp fc (length as) (PRef ffc f) as
1661 alts -> Right $
1661 alts -> Right $
1662 PAlternative True $
1662 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'))
1664 (insertImpl ns as)) alts
1664 (insertImpl ns as)) alts
1666 -- if the name is in imp_meths, we should actually refer to the bound
1666 -- if the name is in imp_meths, we should actually refer to the bound