@@ -52,9 +52,15 @@ elabType info syn doc fc opts n ty' = {- let ty' = piBind (params info) ty_in
5252 do checkUndefined fc n
5353 ctxt <- getContext
5454 i <- getIState
55+
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+
5560 logLvl 3 $ show n ++ " pre-type " ++ showImp Nothing True False ty'
5661 ty' <- addUsingConstraints syn fc ty'
5762 ty' <- implicit syn n ty'
63+
5864 let ty = addImpl i ty'
5965 logLvl 2 $ show n ++ " type " ++ showImp Nothing True False ty
6066 ((tyT, defer, is), log) <-
@@ -406,10 +412,10 @@ elabRecord info syn doc fc tyn ty cdoc cn cty
406412 show fn ++ " (" ++ show ty ++ ")"
407413 putIState i)
408414
409− getImplB k (PPi (Imp l s _) n Placeholder sc)
415+ getImplB k (PPi (Imp l s _ _) n Placeholder sc)
410416 = getImplB k sc
411− getImplB k (PPi (Imp l s d) n ty sc)
412− = getImplB (\x -> k (PPi (Imp l s d) n ty x)) sc
417+ getImplB k (PPi (Imp l s d p) n ty sc)
418+ = getImplB (\x -> k (PPi (Imp l s d p) n ty x)) sc
413419 getImplB k (PPi _ n ty sc)
414420 = getImplB k sc
415421 getImplB k _ = k
@@ -1244,8 +1250,8 @@ elabClass info syn doc fc constraints tn ps ds
12441250 return [PTy doc syn fc o m ty',
12451251 PClauses fc [Inlinable] m [PClause fc m lhs [] rhs []]]
12461252
1247− getMArgs (PPi (Imp _ _ _) n ty sc) = IA : getMArgs sc
1248− getMArgs (PPi (Exp _ _ _) n ty sc) = EA : getMArgs sc
1253+ getMArgs (PPi (Imp _ _ _ _) n ty sc) = IA : getMArgs sc
1254+ getMArgs (PPi (Exp _ _ _ _) n ty sc) = EA : getMArgs sc
12491255 getMArgs (PPi (Constraint _ _ _) n ty sc) = CA : getMArgs sc
12501256 getMArgs _ = []
12511257
@@ -1262,14 +1268,14 @@ elabClass info syn doc fc constraints tn ps ds
12621268 rhsArgs (CA : xs) ns = pconst (PResolveTC fc) : rhsArgs xs ns
12631269 rhsArgs [] _ = []
12641270
1265− insertConstraint c (PPi p@(Imp _ _ _) n ty sc)
1271+ insertConstraint c (PPi p@(Imp _ _ _ _) n ty sc)
12661272 = PPi p n ty (insertConstraint c sc)
12671273 insertConstraint c sc = PPi constraint (MN 0 "class") c sc
12681274
12691275 -- make arguments explicit and don't bind class parameters
1270− toExp ns e (PPi (Imp l s _) n ty sc)
1276+ toExp ns e (PPi (Imp l s _ p) n ty sc)
12711277 | n `elem` ns = toExp ns e sc
1272− | otherwise = PPi (e l s "") n ty (toExp ns e sc)
1278+ | otherwise = PPi (e l s "" p) n ty (toExp ns e sc)
12731279 toExp ns e (PPi p n ty sc) = PPi p n ty (toExp ns e sc)
12741280 toExp ns e sc = sc
12751281
@@ -1364,9 +1370,9 @@ elabInstance info syn fc cs n ps t expn ds
13641370 lamBind i (PPi _ n ty sc) sc'
13651371 = PLam (MN i "meth") Placeholder (lamBind (i+1) sc sc')
13661372 lamBind i _ sc = sc
1367− methArgs i (PPi (Imp _ _ _) n ty sc)
1373+ methArgs i (PPi (Imp _ _ _ _) n ty sc)
13681374 = PImp 0 True False n (PRef fc (MN i "meth")) "" : methArgs (i+1) sc
1369− methArgs i (PPi (Exp _ _ _) n ty sc)
1375+ methArgs i (PPi (Exp _ _ _ _) n ty sc)
13701376 = PExp 0 False (PRef fc (MN i "meth")) "" : methArgs (i+1) sc
13711377 methArgs i (PPi (Constraint _ _ _) n ty sc)
13721378 = PConstraint 0 False (PResolveTC fc) "" : methArgs (i+1) sc
@@ -1393,7 +1399,7 @@ elabInstance info syn fc cs n ps t expn ds
13931399 conbind (ty : ns) x = PPi constraint (MN 0 "class") ty (conbind ns x)
13941400 conbind [] x = x
13951401
1396− coninsert cs (PPi p@(Imp _ _ _) n t sc) = PPi p n t (coninsert cs sc)
1402+ coninsert cs (PPi p@(Imp _ _ _ _) n t sc) = PPi p n t (coninsert cs sc)
13971403 coninsert cs sc = conbind cs sc
13981404
13991405 insertDefaults :: IState -> Name ->