@@ -84,8 +84,11 @@ elabType' norm info syn doc argDocs fc opts n ty' = {- let ty' = piBind (params
8484 ty' <- addUsingConstraints syn fc ty'
8585 ty' <- implicit info syn n ty'
8686
87− let ty = addImpl i ty'
87+ let ty = addImpl i ty'
88+ inacc = inaccessible 0 ty
8889 logLvl 3 $ show n ++ " type " ++ showTmImpls ty
90+ logLvl 5 $ "Erased params: " ++ show inacc
91+
8992 ((tyT, defer, is), log) <-
9093 tclift $ elaborate ctxt n (TType (UVal 0)) []
9194 (errAt "type of " n (erun fc (build i info False [] n ty)))
@@ -161,6 +164,16 @@ elabType' norm info syn doc argDocs fc opts n ty' = {- let ty' = piBind (params
161164 lst = txt "List"
162165 errrep = txt "ErrorReportPart"
163166
167+ inaccessible :: Int -> PTerm -> [Int]
168+ inaccessible i (PPi (Imp _ _ _ _) n Placeholder t)
169+ = i : inaccessible (i+1) t -- unbound implicit
170+ inaccessible i (PPi plicity n ty t)
171+ | InaccessibleArg `elem` pargopts plicity
172+ = i : inaccessible (i+1) t -- an .{erased : Implicit}
173+ | otherwise
174+ = inaccessible (i+1) t -- a {regular : Implicit}
175+ inaccessible _ _ = []
176+
164177 tyIsHandler (Bind _ (Pi (P _ (NS (UN e) ns1) _))
165178 (App (P _ (NS (UN m) ns2) _)
166179 (App (P _ (NS (UN l) ns3) _)