@@ -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'
@@ -858,7 +863,8 @@ elabValBind info aspat tm_in
858 let vtm = orderPats (getInferTerm tm')
863 let vtm = orderPats (getInferTerm tm')
860 def' <- checkDef (fileFC "(input)") defer
865 def' <- checkDef (fileFC "(input)") defer
866+ let def'' = map (\(n, (i, top, t)) -> (n, (i, top, t, True))) def'
861− addDeferred def'
867+ addDeferred def''
862 mapM_ (elabCaseBlock info []) is
868 mapM_ (elabCaseBlock info []) is
864 logLvl 3 ("Value: " ++ show vtm)
870 logLvl 3 ("Value: " ++ show vtm)
@@ -978,7 +984,8 @@ elabClause info opts (cnum, PClause fc fname lhs_in withs rhs_in whereblock)
978 logLvl 2 $ "---> " ++ show rhs'
984 logLvl 2 $ "---> " ++ show rhs'
979 when (not (null defer)) $ iLOG $ "DEFERRED " ++ show defer
985 when (not (null defer)) $ iLOG $ "DEFERRED " ++ show defer
980 def' <- checkDef fc defer
986 def' <- checkDef fc defer
987+ let def'' = map (\(n, (i, top, t)) -> (n, (i, top, t, False))) def'
981− addDeferred def'
988+ addDeferred def''
983 -- Now the remaining deferred (i.e. no type declarations) clauses
990 -- Now the remaining deferred (i.e. no type declarations) clauses
984 -- from the where block
991 -- from the where block
@@ -1097,7 +1104,8 @@ elabClause info opts (_, PWith fc fname lhs_in withs wval_in withblock)
1097 tt <- get_term
1104 tt <- get_term
1098 return (tt, d, is))
1105 return (tt, d, is))
1099 def' <- checkDef fc defer
1106 def' <- checkDef fc defer
1107+ let def'' = map (\(n, (i, top, t)) -> (n, (i, top, t, False))) def'
1100− addDeferred def'
1108+ addDeferred def''
1101 mapM_ (elabCaseBlock info opts) is
1109 mapM_ (elabCaseBlock info opts) is
1102 (cwval, cwvalty) <- recheckC fc [] (getInferTerm wval')
1110 (cwval, cwvalty) <- recheckC fc [] (getInferTerm wval')
1103 let cwvaltyN = explicitNames cwvalty
1111 let cwvaltyN = explicitNames cwvalty
@@ -1128,7 +1136,8 @@ elabClause info opts (_, PWith fc fname lhs_in withs wval_in withblock)
1128 putIState (i { idris_implicits = addDef wname imps (idris_implicits i) })
1136 putIState (i { idris_implicits = addDef wname imps (idris_implicits i) })
1129 addIBC (IBCDef wname)
1137 addIBC (IBCDef wname)
1130 def' <- checkDef fc [(wname, (-1, Nothing, wtype))]
1138 def' <- checkDef fc [(wname, (-1, Nothing, wtype))]
1139+ let def'' = map (\(n, (i, top, t)) -> (n, (i, top, t, False))) def'
1131− addDeferred def'
1140+ addDeferred def''
1133 -- in the subdecls, lhs becomes:
1142 -- in the subdecls, lhs becomes:
1134 -- fname pats | wpat [rest]
1143 -- fname pats | wpat [rest]
@@ -1156,7 +1165,8 @@ elabClause info opts (_, PWith fc fname lhs_in withs wval_in withblock)
1156 tt <- get_term
1165 tt <- get_term
1157 return (tt, d, is))
1166 return (tt, d, is))
1158 def' <- checkDef fc defer
1167 def' <- checkDef fc defer
1168+ let def'' = map (\(n, (i, top, t)) -> (n, (i, top, t, False))) def'
1159− addDeferred def'
1169+ addDeferred def''
1160 mapM_ (elabCaseBlock info opts) is
1170 mapM_ (elabCaseBlock info opts) is
1161 logLvl 5 ("Checked RHS " ++ show rhs')
1171 logLvl 5 ("Checked RHS " ++ show rhs')
1162 (crhs, crhsty) <- recheckC fc [] rhs'
1172 (crhs, crhsty) <- recheckC fc [] rhs'