@@ -63,7 +63,8 @@ elabType info syn doc fc opts n ty' = {- let ty' = piBind (params info) ty_in
63 tclift $ elaborate ctxt n (TType (UVal 0)) []
63 tclift $ elaborate ctxt n (TType (UVal 0)) []
64 (errAt "type of " n (erun fc (build i info False n ty)))
64 (errAt "type of " n (erun fc (build i info False n ty)))
65 ds <- checkDef fc defer
65 ds <- checkDef fc defer
66+ let ds' = map (\(n, (i, top, t)) -> (n, (i, top, t, True))) ds
66− addDeferred ds
67+ addDeferred ds'
67 mapM_ (elabCaseBlock info opts) is
68 mapM_ (elabCaseBlock info opts) is
68 ctxt <- getContext
69 ctxt <- getContext
69 logLvl 5 $ "Rechecking"
70 logLvl 5 $ "Rechecking"
@@ -89,7 +90,8 @@ elabType info syn doc fc opts n ty' = {- let ty' = piBind (params info) ty_in
89 let opts' = if corec then (Coinductive : opts) else opts
90 let opts' = if corec then (Coinductive : opts) else opts
90 ds <- checkDef fc [(n, (-1, Nothing, nty))]
91 ds <- checkDef fc [(n, (-1, Nothing, nty))]
91 addIBC (IBCDef n)
92 addIBC (IBCDef n)
93+ let ds' = map (\(n, (i, top, t)) -> (n, (i, top, t, True))) ds
92− addDeferred ds
94+ addDeferred ds'
93 setFlags n opts'
95 setFlags n opts'
94 addDocStr n doc
96 addDocStr n doc
95 addIBC (IBCDoc n)
97 addIBC (IBCDoc n)
@@ -143,7 +145,8 @@ elabData info syn doc fc codata (PLaterdecl n t_in)
143 ((t', defer, is), log) <- tclift $ elaborate ctxt n (TType (UVal 0)) []
145 ((t', defer, is), log) <- tclift $ elaborate ctxt n (TType (UVal 0)) []
144 (erun fc (build i info False n t))
146 (erun fc (build i info False n t))
145 def' <- checkDef fc defer
147 def' <- checkDef fc defer
148+ let def'' = map (\(n, (i, top, t)) -> (n, (i, top, t, True))) def'
146− addDeferredTyCon def'
149+ addDeferredTyCon def''
147 mapM_ (elabCaseBlock info []) is
150 mapM_ (elabCaseBlock info []) is
148 (cty, _) <- recheckC fc [] t'
151 (cty, _) <- recheckC fc [] t'
149 logLvl 2 $ "---> " ++ show cty
152 logLvl 2 $ "---> " ++ show cty
@@ -160,7 +163,8 @@ elabData info syn doc fc codata (PDatadecl n t_in dcons)
160 tclift $ elaborate ctxt n (TType (UVal 0)) []
163 tclift $ elaborate ctxt n (TType (UVal 0)) []
161 (errAt "data declaration " n (erun fc (build i info False n t)))
164 (errAt "data declaration " n (erun fc (build i info False n t)))
162 def' <- checkDef fc defer
165 def' <- checkDef fc defer
166+ let def'' = map (\(n, (i, top, t)) -> (n, (i, top, t, True))) def'
163− addDeferredTyCon def'
167+ addDeferredTyCon def''
164 mapM_ (elabCaseBlock info []) is
168 mapM_ (elabCaseBlock info []) is
165 (cty, _) <- recheckC fc [] t'
169 (cty, _) <- recheckC fc [] t'
166 logLvl 2 $ "---> " ++ show cty
170 logLvl 2 $ "---> " ++ show cty
@@ -507,7 +511,8 @@ elabCon info syn tn codata (doc, n, t_in, fc)
507 (errAt "constructor " n (erun fc (build i info False n t)))
511 (errAt "constructor " n (erun fc (build i info False n t)))
508 logLvl 2 $ "Rechecking " ++ show t'
512 logLvl 2 $ "Rechecking " ++ show t'
509 def' <- checkDef fc defer
513 def' <- checkDef fc defer
514+ let def'' = map (\(n, (i, top, t)) -> (n, (i, top, t, True))) def'
510− addDeferred def'
515+ addDeferred def''
511 mapM_ (elabCaseBlock info []) is
516 mapM_ (elabCaseBlock info []) is
512 ctxt <- getContext
517 ctxt <- getContext
513 (cty, _) <- recheckC fc [] t'
518 (cty, _) <- recheckC fc [] t'
@@ -860,7 +865,8 @@ elabValBind info aspat tm_in
860 let vtm = orderPats (getInferTerm tm')
865 let vtm = orderPats (getInferTerm tm')
862 def' <- checkDef (fileFC "(input)") defer
867 def' <- checkDef (fileFC "(input)") defer
868+ let def'' = map (\(n, (i, top, t)) -> (n, (i, top, t, True))) def'
863− addDeferred def'
869+ addDeferred def''
864 mapM_ (elabCaseBlock info []) is
870 mapM_ (elabCaseBlock info []) is
866 logLvl 3 ("Value: " ++ show vtm)
872 logLvl 3 ("Value: " ++ show vtm)
@@ -980,7 +986,8 @@ elabClause info opts (cnum, PClause fc fname lhs_in withs rhs_in whereblock)
980 logLvl 2 $ "---> " ++ show rhs'
986 logLvl 2 $ "---> " ++ show rhs'
981 when (not (null defer)) $ iLOG $ "DEFERRED " ++ show defer
987 when (not (null defer)) $ iLOG $ "DEFERRED " ++ show defer
982 def' <- checkDef fc defer
988 def' <- checkDef fc defer
989+ let def'' = map (\(n, (i, top, t)) -> (n, (i, top, t, False))) def'
983− addDeferred def'
990+ addDeferred def''
985 -- Now the remaining deferred (i.e. no type declarations) clauses
992 -- Now the remaining deferred (i.e. no type declarations) clauses
986 -- from the where block
993 -- from the where block
@@ -1099,7 +1106,8 @@ elabClause info opts (_, PWith fc fname lhs_in withs wval_in withblock)
1099 tt <- get_term
1106 tt <- get_term
1100 return (tt, d, is))
1107 return (tt, d, is))
1101 def' <- checkDef fc defer
1108 def' <- checkDef fc defer
1109+ let def'' = map (\(n, (i, top, t)) -> (n, (i, top, t, False))) def'
1102− addDeferred def'
1110+ addDeferred def''
1103 mapM_ (elabCaseBlock info opts) is
1111 mapM_ (elabCaseBlock info opts) is
1104 (cwval, cwvalty) <- recheckC fc [] (getInferTerm wval')
1112 (cwval, cwvalty) <- recheckC fc [] (getInferTerm wval')
1105 let cwvaltyN = explicitNames cwvalty
1113 let cwvaltyN = explicitNames cwvalty
@@ -1130,7 +1138,8 @@ elabClause info opts (_, PWith fc fname lhs_in withs wval_in withblock)
1130 putIState (i { idris_implicits = addDef wname imps (idris_implicits i) })
1138 putIState (i { idris_implicits = addDef wname imps (idris_implicits i) })
1131 addIBC (IBCDef wname)
1139 addIBC (IBCDef wname)
1132 def' <- checkDef fc [(wname, (-1, Nothing, wtype))]
1140 def' <- checkDef fc [(wname, (-1, Nothing, wtype))]
1141+ let def'' = map (\(n, (i, top, t)) -> (n, (i, top, t, False))) def'
1133− addDeferred def'
1142+ addDeferred def''
1135 -- in the subdecls, lhs becomes:
1144 -- in the subdecls, lhs becomes:
1136 -- fname pats | wpat [rest]
1145 -- fname pats | wpat [rest]
@@ -1158,7 +1167,8 @@ elabClause info opts (_, PWith fc fname lhs_in withs wval_in withblock)
1158 tt <- get_term
1167 tt <- get_term
1159 return (tt, d, is))
1168 return (tt, d, is))
1160 def' <- checkDef fc defer
1169 def' <- checkDef fc defer
1170+ let def'' = map (\(n, (i, top, t)) -> (n, (i, top, t, False))) def'
1161− addDeferred def'
1171+ addDeferred def''
1162 mapM_ (elabCaseBlock info opts) is
1172 mapM_ (elabCaseBlock info opts) is
1163 logLvl 5 ("Checked RHS " ++ show rhs')
1173 logLvl 5 ("Checked RHS " ++ show rhs')
1164 (crhs, crhsty) <- recheckC fc [] rhs'
1174 (crhs, crhsty) <- recheckC fc [] rhs'