@@ -37,6 +37,7 @@ import Data.Maybe
3737import Debug.Trace
3838
3939import qualified Data.Map as Map
40+import qualified Data.Set as S
4041import qualified Data.Text as T
4142import Data.Char(isLetter, toLower)
4243import Data.List.Split (splitOn)
@@ -204,8 +205,15 @@ inaccessibleArgs _ _ = []
204205
205206elabPostulate :: ElabInfo -> SyntaxInfo -> Docstring ->
206207 FC -> FnOpts -> Name -> PTerm -> Idris ()
207−elabPostulate info syn doc fc opts n ty
208− = do elabType info syn doc [] fc opts n ty
208+elabPostulate info syn doc fc opts n ty = do
209+ elabType info syn doc [] fc opts n ty
210+ putIState . (\ist -> ist{ idris_postulates = S.insert n (idris_postulates ist) }) =<< getIState
211+
212+ -- remove it from the deferred definitions list
213+ solveDeferred n
214+
215+{- NB. this check has been superseded by usage analysis
216+ -
209217 -- make sure it's collapsible, so it is never needed at run time
210218 -- start by getting the elaborated type
211219 ctxt <- getContext
@@ -214,6 +222,7 @@ elabPostulate info syn doc fc opts n ty
214222 [ty] -> return ty
215223 ist <- getIState
216224 let (ap, _) = unApply (getRetTy (normalise ctxt [] fty))
225+
217226 logLvl 5 $ "Checking collapsibility of " ++ show (ap, fty)
218227 let postOK = case ap of
219228 P _ tn _ -> case lookupCtxt tn
@@ -223,8 +232,8 @@ elabPostulate info syn doc fc opts n ty
223232 _ -> False
224233 when (not postOK)
225234 $ tclift $ tfail (At fc (NonCollapsiblePostulate n))
226− -- remove it from the deferred definitions list
227− solveDeferred n
235+-}
236+
228237
229238elabData :: ElabInfo -> SyntaxInfo -> Docstring -> [(Name, Docstring)] -> FC -> DataOpts -> PData -> Idris ()
230239elabData info syn doc argDocs fc opts (PLaterdecl n t_in)