@@ -16,7 +16,7 @@ import Idris.Core.TT
1616import Idris.Core.Evaluate
1717import Idris.Core.Unify
1818import Idris.Core.ProofTerm (getProofTerm)
19−import Idris.Core.Typecheck (check, recheck, isType)
19+import Idris.Core.Typecheck (check, recheck, converts, isType)
2020import Idris.Coverage (buildSCG, checkDeclTotality, genClauses, recoverableCoverage, validCoverageCase)
2121import Idris.ErrReverse (errReverse)
2222import Idris.ElabQuasiquote (extractUnquotes)
@@ -1136,7 +1136,7 @@ elab ist info emode opts fn tm
11361136 delayElab 10 $ do focus h
11371137 dotterm
11381138 elab' ina fc t
1139− elab' ina fc (PRunElab fc' tm) =
1139+ elab' ina fc (PRunElab fc' tm ns) =
11401140 do attack
11411141 n <- getNameFrom (sMN 0 "tacticScript")
11421142 n' <- getNameFrom (sMN 0 "tacticExpr")
@@ -1149,7 +1149,7 @@ elab ist info emode opts fn tm
11491149 focus n
11501150 elab' ina (Just fc') tm
11511151 env <- get_env
1152− runTactical ist (maybe fc' id fc) env (P Bound n' Erased)
1152+ runTactical ist (maybe fc' id fc) env (P Bound n' Erased) ns
11531153 solve
11541154 elab' ina fc x = fail $ "Unelaboratable syntactic form " ++ showTmImpls x
11551155
@@ -1697,10 +1697,10 @@ case_ ind autoSolve ist fn tm = do
16971697 when autoSolve solveAll
16981698
16991699
1700−runTactical :: IState -> FC -> Env -> Term -> ElabD ()
1701−runTactical ist fc env tm = do tm' <- eval tm
1702− runTacTm tm'
1703− return ()
1700+runTactical :: IState -> FC -> Env -> Term -> [String] -> ElabD ()
1701+runTactical ist fc env tm ns = do tm' <- eval tm
1702+ runTacTm tm'
1703+ return ()
17041704 where
17051705 eval tm = do ctxt <- get_context
17061706 return $ normaliseAll ctxt env (finalise tm)
@@ -1721,8 +1721,9 @@ runTactical ist fc env tm = do tm' <- eval tm
17211721 let info = CaseInfo True True False -- TODO document and figure out
17221722 clauses' <- forM clauses (\case
17231723 RMkFunClause lhs rhs ->
1724− do lhs' <- fmap fst . lift $ check ctxt [] lhs
1725− rhs' <- fmap fst . lift $ check ctxt [] rhs
1724+ do (lhs', lty) <- lift $ check ctxt [] lhs
1725+ (rhs', rty) <- lift $ check ctxt [] rhs
1726+ lift $ converts ctxt [] lty rty
17261727 return $ Right (lhs', rhs')
17271728 RMkImpossibleClause lhs ->
17281729 do lhs' <- fmap fst . lift $ check ctxt [] lhs
@@ -1812,6 +1813,9 @@ runTactical ist fc env tm = do tm' <- eval tm
18121813 | n == tacN "prim__SourceLocation", [] <- args
18131814 = fmap fst . checkClosed $
18141815 reflectFC fc
1816+ | n == tacN "prim__Namespace", [] <- args
1817+ = fmap fst . checkClosed $
1818+ rawList (RConstant StrType) (map (RConstant . Str) ns)
18151819 | n == tacN "prim__Env", [] <- args
18161820 = do env <- get_env
18171821 fmap fst . checkClosed $ reflectEnv env
@@ -1960,7 +1964,7 @@ runTactical ist fc env tm = do tm' <- eval tm
19601964 datatypes <- get_datatypes
19611965 env <- get_env
19621966 (_, ES (p, aux') _ _) <-
1963− lift $ runElab aux (runTactical ist fc [] script)
1967+ lift $ runElab aux (runTactical ist fc [] script ns)
19641968 (newProof recH ctxt datatypes goalTT)
19651969 let tm_out = getProofTerm (pterm p)
19661970 updateAux $ const aux'