@@ -761,11 +761,15 @@ runTac autoSolve ist tac
761 runT (Exact tm) = do elab ist toplevel False False (MN 0 "tac") tm
761 runT (Exact tm) = do elab ist toplevel False False (MN 0 "tac") tm
762 when autoSolve solveAll
762 when autoSolve solveAll
763 runT (MatchRefine fn)
763 runT (MatchRefine fn)
764− = do (fn', imps) <- case lookupCtxtName fn (idris_implicits ist) of
765+ case lookupCtxtName fn (idris_implicits ist) of
765− [] -> do a <- envArgs fn
766+ [] -> do a <- envArgs fn
766− return (fn, a)
767+ return [(fn, a)]
767− [(n, args)] -> return $ (n, map (const True) args)
768+ ns -> return (map (\ (n, a) -> (n, map (const True) a)) ns)
769+ let tacs = map (\ (fn', imps) ->
768− ns <- match_apply (Var fn') (map (\x -> (x, 0)) imps)
770+ (match_apply (Var fn') (map (\x -> (x, 0)) imps),
769 when autoSolve solveAll
773 when autoSolve solveAll
770 where envArgs n = do e <- get_env
774 where envArgs n = do e <- get_env
771 case lookup n e of
775 case lookup n e of
@@ -773,12 +777,15 @@ runTac autoSolve ist tac
773 (getArgTys (binderTy t))
777 (getArgTys (binderTy t))
774 _ -> return []
778 _ -> return []
775 runT (Refine fn [])
779 runT (Refine fn [])
776− = do (fn', imps) <- case lookupCtxtName fn (idris_implicits ist) of
781+ case lookupCtxtName fn (idris_implicits ist) of
777− [] -> do a <- envArgs fn
782+ [] -> do a <- envArgs fn
778− return (fn, a)
783+ return [(fn, a)]
779− -- FIXME: resolve ambiguities
780− [(n, args)] -> return $ (n, map isImp args)
784+ ns -> return (map (\ (n, a) -> (n, map isImp a)) ns)
785+ let tacs = map (\ (fn', imps) ->
781− ns <- apply (Var fn') (map (\x -> (x, 0)) imps)
786+ (apply (Var fn') (map (\x -> (x, 0)) imps),
782 when autoSolve solveAll
789 when autoSolve solveAll
783 where isImp (PImp _ _ _ _ _) = True
790 where isImp (PImp _ _ _ _ _) = True
784 isImp _ = False
791 isImp _ = False