@@ -49,9 +49,18 @@ recheckC fc env t
4949 addConstraints fc cs
5050 return (tm, ty)
5151
52−checkDef fc ns = do ctxt <- getContext
53− mapM (\(n, (i, top, t)) -> do (t', _) <- recheckC fc [] t
54− return (n, (i, top, t'))) ns
52+
53+checkDef fc ns = checkAddDef False fc ns
54+
55+checkAddDef add fc [] = return []
56+checkAddDef add fc ((n, (i, top, t)) : ns)
57+ = do ctxt <- getContext
58+ (t', _) <- recheckC fc [] t
59+ when add $ addDeferred [(n, (i, top, t, True))]
60+ ns' <- checkAddDef add fc ns
61+ return ((n, (i, top, t')) : ns')
62+-- mapM (\(n, (i, top, t)) -> do (t', _) <- recheckC fc [] t
63+-- return (n, (i, top, t'))) ns
5564
5665-- | Elaborate a top-level type declaration - for example, "foo : Int -> Int".
5766elabType :: ElabInfo -> SyntaxInfo -> String ->
@@ -76,9 +85,9 @@ elabType' norm info syn doc fc opts n ty' = {- let ty' = piBind (params info) ty
7685 ((tyT, defer, is), log) <-
7786 tclift $ elaborate ctxt n (TType (UVal 0)) []
7887 (errAt "type of " n (erun fc (build i info False [] n ty)))
79− ds <- checkDef fc defer
80− let ds' = map (\(n, (i, top, t)) -> (n, (i, top, t, True))) ds
81− addDeferred ds'
88+ ds <- checkAddDef True fc defer
89+-- let ds' = map (\(n, (i, top, t)) -> (n, (i, top, t, True))) ds
90+-- addDeferred ds'
8291 mapM_ (elabCaseBlock info opts) is
8392 ctxt <- getContext
8493 logLvl 5 $ "Rechecking"