@@ -1007,11 +1007,11 @@ isTCDict n ctxt
1007 _ -> False
1007 _ -> False
1009lookupP :: Name -> Context -> [Term]
1009lookupP :: Name -> Context -> [Term]
1010−lookupP = lookupP_all False
1010+lookupP = lookupP_all False False
1012−lookupP_all :: Bool -> Name -> Context -> [Term]
1012+lookupP_all :: Bool -> Bool -> Name -> Context -> [Term]
1013−lookupP_all all n ctxt
1013+lookupP_all all exact n ctxt
1014− = do (n', def) <- lookupCtxtName n (definitions ctxt)
1014+ = do (n', def) <- names
1015 p <- case def of
1015 p <- case def of
1016 (Function ty tm, a, _, _) -> return (P Ref n' ty, a)
1016 (Function ty tm, a, _, _) -> return (P Ref n' ty, a)
1017 (TyDecl nt ty, a, _, _) -> return (P nt n' ty, a)
1017 (TyDecl nt ty, a, _, _) -> return (P nt n' ty, a)
@@ -1020,6 +1020,11 @@ lookupP_all all n ctxt
1020 case snd p of
1020 case snd p of
1021 Hidden -> if all then return (fst p) else []
1021 Hidden -> if all then return (fst p) else []
1022 _ -> return (fst p)
1022 _ -> return (fst p)
1024+ names = let ns = lookupCtxtName n (definitions ctxt) in
1026+ then filter (\ (n', d) -> n' == n) ns
1024lookupDefExact :: Name -> Context -> Maybe Def
1029lookupDefExact :: Name -> Context -> Maybe Def
1025lookupDefExact n ctxt = tfst <$> lookupCtxtExact n (definitions ctxt)
1030lookupDefExact n ctxt = tfst <$> lookupCtxtExact n (definitions ctxt)