@@ -53,10 +53,6 @@ elabType info syn doc fc opts n ty' = {- let ty' = piBind (params info) ty_in
5353 ctxt <- getContext
5454 i <- getIState
5555
56− -- Add user one, not implicitsed one
57− addInternalApp (fc_fname fc) (fc_line fc) ty'
58− addIBC (IBCLineApp (fc_fname fc) (fc_line fc) ty')
59−
6056 logLvl 3 $ show n ++ " pre-type " ++ showImp Nothing True False ty'
6157 ty' <- addUsingConstraints syn fc ty'
6258 ty' <- implicit syn n ty'
@@ -79,6 +75,11 @@ elabType info syn doc fc opts n ty' = {- let ty' = piBind (params info) ty_in
7975 let nty = cty -- normalise ctxt [] cty
8076 -- if the return type is something coinductive, freeze the definition
8177 let nty' = normalise ctxt [] nty
78+
79+ -- Add normalised type to internals
80+ addInternalApp (fc_fname fc) (fc_line fc) (delab i nty')
81+ addIBC (IBCLineApp (fc_fname fc) (fc_line fc) (delab i nty'))
82+
8283 let (t, _) = unApply (getRetTy nty')
8384 let corec = case t of
8485 P _ rcty _ -> case lookupCtxt rcty (idris_datatypes i) of
@@ -832,11 +833,12 @@ elabClause info opts (cnum, PClause fc fname lhs_in withs rhs_in whereblock)
832833 logLvl 3 ("Elaborated: " ++ show lhs_tm)
833834 logLvl 3 ("Elaborated type: " ++ show lhs_ty)
834835
835− addInternalApp (fc_fname fc) (fc_line fc) (delab i lhs_tm)
836− addIBC (IBCLineApp (fc_fname fc) (fc_line fc) (delab i lhs_tm))
837−
838836 (clhs_c, clhsty) <- recheckC fc [] lhs_tm
839837 let clhs = normalise ctxt [] clhs_c
838+
839+ addInternalApp (fc_fname fc) (fc_line fc) (delab i clhs)
840+ addIBC (IBCLineApp (fc_fname fc) (fc_line fc) (delab i clhs))
841+
840842 logLvl 5 ("Checked " ++ show clhs ++ "\n" ++ show clhsty)
841843 -- Elaborate where block
842844 ist <- getIState