@@ -99,6 +99,10 @@ elabImplementation info syn doc argDocs what fc cs parents acc opts n nfc ps pex
99 (map fst $ interface_implementations ci)
99 (map fst $ interface_implementations ci)
100 addImplementation intImpl True n iname
100 addImplementation intImpl True n iname
101 _ -> addImplementation intImpl False n iname
101 _ -> addImplementation intImpl False n iname
104+ checkInjectiveArgs fc n (interface_determiners ci) (lookupTyExact iname (tt_ctxt ist))
102 when (what /= ETypes && (not (null ds && not emptyinterface))) $ do
106 when (what /= ETypes && (not (null ds && not emptyinterface))) $ do
103 -- Add the parent implementation names to the privileged set
107 -- Add the parent implementation names to the privileged set
104 oldOpen <- addOpenImpl parents
108 oldOpen <- addOpenImpl parents
@@ -212,7 +216,6 @@ elabImplementation info syn doc argDocs what fc cs parents acc opts n nfc ps pex
212 setOpenImpl oldOpen
216 setOpenImpl oldOpen
213-- totalityCheckBlock
217-- totalityCheckBlock
215− checkInjectiveArgs fc n (interface_determiners ci) (lookupTyExact iname (tt_ctxt ist))
216 addIBC (IBCImplementation intImpl (isNothing expn) n iname)
219 addIBC (IBCImplementation intImpl (isNothing expn) n iname)
@@ -243,9 +246,6 @@ elabImplementation info syn doc argDocs what fc cs parents acc opts n nfc ps pex
243 (_:_) -> return True
246 (_:_) -> return True
244 _ -> return False -- couldn't find interface, just let elabImplementation fail later
247 _ -> return False -- couldn't find interface, just let elabImplementation fail later
246− -- TODO: largely based upon elabType' - should try to abstract
247− -- Issue #1614 in the issue tracker:
248− -- https://github.com/idris-lang/Idris-dev/issues/1614
249 elabFindOverlapping i ci iname syn t
249 elabFindOverlapping i ci iname syn t
250 = do ty' <- addUsingConstraints syn fc t
250 = do ty' <- addUsingConstraints syn fc t
251 -- TODO think: something more in info?
251 -- TODO think: something more in info?
@@ -506,7 +506,8 @@ checkInjectiveArgs fc n ds (Just ty)
506 isInj i (P _ n _) = isConName n (tt_ctxt i)
506 isInj i (P _ n _) = isConName n (tt_ctxt i)
507 isInj i (App _ f a) = isInj i f && isInj i a
507 isInj i (App _ f a) = isInj i f && isInj i a
508 isInj i (V _) = True
508 isInj i (V _) = True
509− isInj i (Bind n b sc) = isInj i sc
509+ isInj i (Bind n b@(Pi{}) sc) = isInj i (binderTy b) && isInj i sc
510+ isInj i (Bind n b sc) = False
510 isInj _ _ = True
511 isInj _ _ = True
512 instantiateRetTy (Bind n (Pi _ _ _ _) sc)
513 instantiateRetTy (Bind n (Pi _ _ _ _) sc)