@@ -87,7 +87,7 @@ elabType' norm info syn doc argDocs fc opts n ty' = {- let ty' = piBind (params
87 let ty = addImpl i ty'
87 let ty = addImpl i ty'
88 inacc = inaccessible 0 ty
88 inacc = inaccessible 0 ty
89 logLvl 3 $ show n ++ " type " ++ showTmImpls ty
89 logLvl 3 $ show n ++ " type " ++ showTmImpls ty
90− logLvl 5 $ "Erased params: " ++ show inacc
90+ logLvl 5 $ "Inaccessible arguments: " ++ show inacc
92 ((tyT, defer, is), log) <-
92 ((tyT, defer, is), log) <-
93 tclift $ elaborate ctxt n (TType (UVal 0)) []
93 tclift $ elaborate ctxt n (TType (UVal 0)) []
@@ -133,8 +133,10 @@ elabType' norm info syn doc argDocs fc opts n ty' = {- let ty' = piBind (params
133 addDocStr n doc argDocs
133 addDocStr n doc argDocs
134 addIBC (IBCDoc n)
134 addIBC (IBCDoc n)
135 addIBC (IBCFlags n opts')
135 addIBC (IBCFlags n opts')
136+ saveInaccArgs n inacc
136 when (Implicit `elem` opts') $ do addCoercion n
137 when (Implicit `elem` opts') $ do addCoercion n
137 addIBC (IBCCoercion n)
138 addIBC (IBCCoercion n)
138 -- If the function is declared as an error handler and the language
140 -- If the function is declared as an error handler and the language
139 -- extension is enabled, then add it to the list of error handlers.
141 -- extension is enabled, then add it to the list of error handlers.
140 errorReflection <- fmap (elem ErrorReflection . idris_language_extensions) getIState
142 errorReflection <- fmap (elem ErrorReflection . idris_language_extensions) getIState
@@ -164,6 +166,19 @@ elabType' norm info syn doc argDocs fc opts n ty' = {- let ty' = piBind (params
164 lst = txt "List"
166 lst = txt "List"
165 errrep = txt "ErrorReportPart"
167 errrep = txt "ErrorReportPart"
169+ saveInaccArgs :: Name -> [Int] -> Idris ()
170+ saveInaccArgs n is = do
172+ case lookupCtxt n (idris_optimisation ist) of
174+ putIState ist{ idris_optimisation =
175+ addDef n oi{ inaccessible = is } (idris_optimisation ist) }
178+ putIState ist{ idris_optimisation =
179+ addDef n (Optimise False False [] [] is) (idris_optimisation ist) }
167 inaccessible :: Int -> PTerm -> [Int]
182 inaccessible :: Int -> PTerm -> [Int]
168 inaccessible i (PPi (Imp _ _ _ _) n Placeholder t)
183 inaccessible i (PPi (Imp _ _ _ _) n Placeholder t)
169 = i : inaccessible (i+1) t -- unbound implicit
184 = i : inaccessible (i+1) t -- unbound implicit
@@ -965,7 +980,7 @@ elabClauses info fc opts n_in cs = let n = liftname info n_in in
965 [oi] -> do let opts = addDef n (oi { collapsible = True })
980 [oi] -> do let opts = addDef n (oi { collapsible = True })
966 (idris_optimisation ist)
981 (idris_optimisation ist)
967 putIState (ist { idris_optimisation = opts })
982 putIState (ist { idris_optimisation = opts })
968− _ -> do let opts = addDef n (Optimise True False [] [])
983+ _ -> do let opts = addDef n (Optimise True False [] [] [])
969 (idris_optimisation ist)
984 (idris_optimisation ist)
970 putIState (ist { idris_optimisation = opts })
985 putIState (ist { idris_optimisation = opts })
971 addIBC (IBCOpt n)
986 addIBC (IBCOpt n)