X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcDeriv.lhs;h=4bad73934cb83912052dd9e91f4e2f2d546c380e;hb=7f1bc015a4094a8282ad4090768d780fd4d6122d;hp=af537409cfe876c2a35618a55ad1203e479ebade;hpb=3548802de235eca280982270463db84910ee3748;p=ghc-hetmet.git diff --git a/compiler/typecheck/TcDeriv.lhs b/compiler/typecheck/TcDeriv.lhs index af53740..4bad739 100644 --- a/compiler/typecheck/TcDeriv.lhs +++ b/compiler/typecheck/TcDeriv.lhs @@ -420,6 +420,7 @@ baleOut err = addErrTc err >> returnM (Nothing, Nothing) \begin{code} mkDataTypeEqn orig gla_exts tvs cls cls_tys tycon tc_args rep_tc rep_tc_args | Just err <- checkSideConditions gla_exts cls cls_tys rep_tc + -- NB: pass the *representation* tycon to checkSideConditions = baleOut (derivingThingErr cls cls_tys (mkTyConApp tycon tc_args) err) | otherwise @@ -496,7 +497,11 @@ sideConditions (dataClassKey, cond_glaExts `andCond` cond_std) ] -type Condition = (Bool, TyCon) -> Maybe SDoc -- Nothing => OK +type Condition = (Bool, TyCon) -> Maybe SDoc + -- Bool is gla-exts flag + -- TyCon is the *representation* tycon if the + -- data type is an indexed one + -- Nothing => OK orCond :: Condition -> Condition -> Condition orCond c1 c2 tc