; gla_exts <- doptM Opt_GlasgowExts
; overlap_flag <- getOverlapFlag
- ; if isDataTyCon tycon then
+
+ -- Be careful to test rep_tc here: in the case of families, we want
+ -- to check the instance tycon, not the family tycon
+ ; if isDataTyCon rep_tc then
mkDataTypeEqn orig gla_exts full_tvs cls cls_tys
tycon full_tc_args rep_tc rep_tc_args
else
new_dfun_name clas tycon -- Just a simple wrapper
- = newDFunName clas [mkTyConApp tycon []] (getSrcLoc tycon)
+ = newDFunName clas [mkTyConApp tycon []] (getSrcSpan tycon)
-- The type passed to newDFunName is only used to generate
-- a suitable string; hence the empty type arg list
\end{code}
nest 2 (ptext SLIT("Offending constraint:") <+> ppr pred)]
\end{code}
-
\ No newline at end of file
+