on master help sign in
Name resolution should respect %hide
6b3457aEdwin Brady
Makefile+4−2
@@ -1,4 +1,4 @@
1−.PHONY: build configure doc install linecount nodefault pinstall relib test
1+.PHONY: build configure doc install linecount nodefault pinstall lib_clean relib test
2
2
3include config.mk
3include config.mk
4-include custom.mk
4-include custom.mk
@@ -22,10 +22,12 @@ test_java:
22test_llvm:
22test_llvm:
23 $(MAKE) -C test IDRIS=../dist/build/idris test_llvm
23 $(MAKE) -C test IDRIS=../dist/build/idris test_llvm
24
24
25−relib:
25+lib_clean:
26 $(MAKE) -C lib IDRIS=../dist/build/idris/idris RTS=../dist/build/rts/libidris_rts clean
26 $(MAKE) -C lib IDRIS=../dist/build/idris/idris RTS=../dist/build/rts/libidris_rts clean
27 $(MAKE) -C effects IDRIS=../dist/build/idris/idris RTS=../dist/build/rts/libidris_rts DIST=../dist/build clean
27 $(MAKE) -C effects IDRIS=../dist/build/idris/idris RTS=../dist/build/rts/libidris_rts DIST=../dist/build clean
28 $(MAKE) -C javascript IDRIS=../dist/build/idris/idris RTS=../dist/build/rts/libidris_rts DIST=../dist/build clean
28 $(MAKE) -C javascript IDRIS=../dist/build/idris/idris RTS=../dist/build/rts/libidris_rts DIST=../dist/build clean
29+
30+relib: lib_clean
29 $(CABAL) install $(CABALFLAGS)
31 $(CABAL) install $(CABALFLAGS)
30
32
31linecount:
33linecount:
src/Core/Evaluate.hs+1−1
@@ -8,7 +8,7 @@ module Core.Evaluate(normalise, normaliseTrace, normaliseC, normaliseAll,
8 Context, initContext, ctxtAlist, uconstraints, next_tvar,
8 Context, initContext, ctxtAlist, uconstraints, next_tvar,
9 addToCtxt, setAccess, setTotal, addCtxtDef, addTyDecl,
9 addToCtxt, setAccess, setTotal, addCtxtDef, addTyDecl,
10 addDatatype, addCasedef, simplifyCasedef, addOperator,
10 addDatatype, addCasedef, simplifyCasedef, addOperator,
11− lookupNames, lookupTy, lookupP, lookupDef, lookupVal,
11+ lookupNames, lookupTy, lookupP, lookupDef, lookupDefAcc, lookupVal,
12 lookupTotal, lookupTyEnv, isDConName, isTConName, isConName, isFnName,
12 lookupTotal, lookupTyEnv, isDConName, isTConName, isConName, isFnName,
13 Value(..), Quote(..), initEval) where
13 Value(..), Quote(..), initEval) where
14
14
src/Idris/AbsSyntax.hs+13−1
@@ -1180,7 +1180,9 @@ aiFn inpat expat ist fc f as
1180 | f `elem` primNames = Right $ PApp fc (PRef fc f) as
1180 | f `elem` primNames = Right $ PApp fc (PRef fc f) as
1181aiFn inpat expat ist fc f as
1181aiFn inpat expat ist fc f as
1182 -- This is where namespaces get resolved by adding PAlternative
1182 -- This is where namespaces get resolved by adding PAlternative
1183− = case lookupCtxtName f (idris_implicits ist) of
1183+ = do let ns = lookupCtxtName f (idris_implicits ist)
1184+ let ns' = filter (\(n, _) -> notHidden n) ns
1185+ case ns' of
1184 [(f',ns)] -> Right $ mkPApp fc (length ns) (PRef fc f') (insertImpl ns as)
1186 [(f',ns)] -> Right $ mkPApp fc (length ns) (PRef fc f') (insertImpl ns as)
1185 [] -> if f `elem` (map fst (idris_metavars ist))
1187 [] -> if f `elem` (map fst (idris_metavars ist))
1186 then Right $ PApp fc (PRef fc f) as
1188 then Right $ PApp fc (PRef fc f) as
@@ -1190,6 +1192,16 @@ aiFn inpat expat ist fc f as
1190 map (\(f', ns) -> mkPApp fc (length ns) (PRef fc f')
1192 map (\(f', ns) -> mkPApp fc (length ns) (PRef fc f')
1191 (insertImpl ns as)) alts
1193 (insertImpl ns as)) alts
1192 where
1194 where
1195+ notHidden n = case getAccessibility n of
1196+ Hidden -> False
1197+ _ -> True
1198+
1199+ getAccessibility n
1200+ = case lookupDefAcc n False (tt_ctxt ist) of
1201+ [(n,t)] -> t
1202+ _ -> Public
1203+
1204+
1193 insertImpl :: [PArg] -> [PArg] -> [PArg]
1205 insertImpl :: [PArg] -> [PArg] -> [PArg]
1194 insertImpl (PExp p l ty _ : ps) (PExp _ _ tm d : given) =
1206 insertImpl (PExp p l ty _ : ps) (PExp _ _ tm d : given) =
1195 PExp p l tm d : insertImpl ps given
1207 PExp p l tm d : insertImpl ps given