@@ -1393,7 +1393,11 @@ getUnboundImplicits i t tm = getImps t (collectImps tm)
13931393 = (n, (p, t)) : collectImps sc
13941394 collectImps _ = []
13951395
1396− getImps (Bind n (Pi (Just _) _ _) sc) imps = getImps sc imps
1396+ scopedimpl (Just i) = not (toplevel_imp i)
1397+ scopedimpl _ = False
1398+
1399+ getImps (Bind n (Pi i _ _) sc) imps
1400+ | scopedimpl i = getImps sc imps
13971401 getImps (Bind n (Pi _ t _) sc) imps
13981402 | Just (p, t') <- lookup n imps = argInfo n p t' : getImps sc imps
13991403 where
@@ -1556,9 +1560,9 @@ implicitise syn ignore ist tm = -- trace ("INCOMING " ++ showImp True tm) $
15561560 pibind using [] sc = sc
15571561 pibind using (n:ns) sc
15581562 = case lookup n using of
1559− Just ty -> PPi (Imp [] Dynamic False Nothing)
1563+ Just ty -> PPi (Imp [] Dynamic False (Just (Impl False True)))
15601564 n NoFC ty (pibind using ns sc)
1561− Nothing -> PPi (Imp [InaccessibleArg] Dynamic False Nothing)
1565+ Nothing -> PPi (Imp [InaccessibleArg] Dynamic False (Just (Impl False True)))
15621566 n NoFC Placeholder (pibind using ns sc)
15631567
15641568-- Add implicit arguments in function calls