-> [LInstDecl Name] -- Source code instance decls
-> [LDerivDecl Name] -- Source code stand-alone deriving decls
-> TcM (TcGblEnv, -- The full inst env
-> [LInstDecl Name] -- Source code instance decls
-> [LDerivDecl Name] -- Source code stand-alone deriving decls
-> TcM (TcGblEnv, -- The full inst env
ptext (sLit "Associated type") <+> quotes (ppr name) <+>
ptext (sLit "must be inside a class instance")
ptext (sLit "Associated type") <+> quotes (ppr name) <+>
ptext (sLit "must be inside a class instance")
tcLocalInstDecl1 (L loc (InstDecl poly_ty binds uprags ats))
= -- Prime error recovery, set source location
recoverM (return ([], [])) $
tcLocalInstDecl1 (L loc (InstDecl poly_ty binds uprags ats))
= -- Prime error recovery, set source location
recoverM (return ([], [])) $
-- Finally, construct the Core representation of the instance.
-- (This no longer includes the associated types.)
-- Finally, construct the Core representation of the instance.
-- (This no longer includes the associated types.)
; overlap_flag <- getOverlapFlag
; let (eq_theta,dict_theta) = partition isEqPred theta
theta' = eq_theta ++ dict_theta
; overlap_flag <- getOverlapFlag
; let (eq_theta,dict_theta) = partition isEqPred theta
theta' = eq_theta ++ dict_theta
-> TcM (LHsBinds Id, TcLclEnv)
-- (a) From each class declaration,
-- generate any default-method bindings
-> TcM (LHsBinds Id, TcLclEnv)
-- (a) From each class declaration,
-- generate any default-method bindings