@@ -579,7 +579,8 @@ elabClause info opts (cnum, PClause fc fname lhs_in_as withs rhs_in_as wherebloc
579 -- If we're inferring metavariables in the type, don't recheck,
579 -- If we're inferring metavariables in the type, don't recheck,
580 -- because we're only doing this to try to work out those metavariables
580 -- because we're only doing this to try to work out those metavariables
581 (clhs_c, clhsty) <- if not inf
581 (clhs_c, clhsty) <- if not inf
582+ then recheckC_borrowing False (PEGenerated `notElem` opts)
582− then recheckC fc id [] lhs_tm
583+ [] fc id [] lhs_tm
583 else return (lhs_tm, lhs_ty)
584 else return (lhs_tm, lhs_ty)
584 let clhs = normalise ctxt [] clhs_c
585 let clhs = normalise ctxt [] clhs_c
585 let borrowed = borrowedNames [] clhs
586 let borrowed = borrowedNames [] clhs
@@ -681,14 +682,16 @@ elabClause info opts (cnum, PClause fc fname lhs_in_as withs rhs_in_as wherebloc
681 logLvl 6 $ " ==> " ++ show (forget rhs')
682 logLvl 6 $ " ==> " ++ show (forget rhs')
683 (crhs, crhsty) <- if not inf
684 (crhs, crhsty) <- if not inf
684− then recheckC_borrowing True borrowed fc id [] rhs'
685+ then recheckC_borrowing True (PEGenerated `notElem` opts)
686+ borrowed fc id [] rhs'
685 else return (rhs', clhsty)
687 else return (rhs', clhsty)
686 logLvl 6 $ " ==> " ++ showEnvDbg [] crhsty ++ " against " ++ showEnvDbg [] clhsty
688 logLvl 6 $ " ==> " ++ showEnvDbg [] crhsty ++ " against " ++ showEnvDbg [] clhsty
687 ctxt <- getContext
689 ctxt <- getContext
688 let constv = next_tvar ctxt
690 let constv = next_tvar ctxt
689 case LState.runStateT (convertsC ctxt [] crhsty clhsty) (constv, []) of
691 case LState.runStateT (convertsC ctxt [] crhsty clhsty) (constv, []) of
692+ OK (_, cs) -> when (PEGenerated `notElem` opts) $ do
690− OK (_, cs) -> do addConstraints fc cs
693+ addConstraints fc cs
691− logLvl 6 $ "CONSTRAINTS ADDED: " ++ show cs
694+ logLvl 6 $ "CONSTRAINTS ADDED: " ++ show cs ++ "\n" ++ show (clhsty, crhsty)
692 return ()
695 return ()
693 Error e -> ierror (At fc (CantUnify False (clhsty, Nothing) (crhsty, Nothing) e [] 0))
696 Error e -> ierror (At fc (CantUnify False (clhsty, Nothing) (crhsty, Nothing) e [] 0))
694 i <- getIState
697 i <- getIState