on master help sign in
Put deferred names in the right namespace
commitaa7262e9add894e4d0fe5932026a45e8177b6991 authorEdwin Brady <ecb10@st-andrews.ac.uk> dateWed 28 Nov 2012, 18:11 (14 years ago) parentf833918
1 file changed+6−1
src/Idris/ElabTerm.hs+6−1
src/Idris/ElabTerm.hs+6−1
@@ -241,7 +241,7 @@ elab ist info pattern tcgen fn tm
241241 let fty = fnTy argTys rty
242242-- trace (show (ptm, map fst argTys)) $ focus fn
243243 -- build and defer the function application
244− attack; deferType f fty (map fst argTys); solve
244+ attack; deferType (mkN f) fty (map fst argTys); solve
245245 -- elaborate the arguments, to unify their types. They all have to
246246 -- be explicit.
247247 mapM_ elabIArg (zip argTys args)
@@ -261,6 +261,11 @@ elab ist info pattern tcgen fn tm
261261
262262 elabIArg ((n, (True, ty)), def) = do focus n; elabE ina (getTm def)
263263 elabIArg _ = return () -- already done, just a name
264+
265+ mkN n@(NS _ _) = n
266+ mkN n = case namespace info of
267+ Just xs@(_:_) -> NS n xs
268+ _ -> n
264269
265270 elab' (ina, g) tm@(PApp fc (PRef _ f) args')
266271 = do let args = {- case lookupCtxt f (inblock info) of