on master help sign in
isFnName should look for exact names

Otherwise we might think a local variable is a function when it shadows a function. Fixes #993

commit7af5df9640da49e4b85038641d95aeafe1ea0522 authorEdwin Brady <ecb10@st-andrews.ac.uk> dateSun 23 Mar 2014, 12:44 (13 years ago) parentc06badb
1 file changed+6−6
src/Idris/Core/Evaluate.hs+6−6
src/Idris/Core/Evaluate.hs+6−6
@@ -889,12 +889,12 @@ isDConName n ctxt
889889
890890isFnName :: Name -> Context -> Bool
891891isFnName n ctxt
892− = or $ do def <- lookupCtxt n (definitions ctxt)
893− case tfst def of
894− (Function _ _) -> return True
895− (Operator _ _ _) -> return True
896− (CaseOp _ _ _ _ _ _) -> return True
897− _ -> return False
892+ = let def = lookupCtxtExact n (definitions ctxt) in
893+ case def of
894+ Just (Function _ _, _, _, _) -> True
895+ Just (Operator _ _ _, _, _, _) -> True
896+ Just (CaseOp _ _ _ _ _ _, _, _, _) -> True
897+ _ -> False
898898
899899lookupP :: Name -> Context -> [Term]
900900lookupP n ctxt