From: simonpj@microsoft.com Date: Mon, 8 Feb 2010 16:37:51 +0000 (+0000) Subject: Fix Trac #3850 X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=dafabe653da4e6cf5aea6b5281c8f77de8d0964a Fix Trac #3850 This patch simply avoids a needless difference in behaviour from 6.10, and one that happens to affect HList. See Note [Stupid theta]. --- diff --git a/compiler/rename/RnSource.lhs b/compiler/rename/RnSource.lhs index bfecfd6..6984a4b 100644 --- a/compiler/rename/RnSource.lhs +++ b/compiler/rename/RnSource.lhs @@ -726,9 +726,10 @@ rnTyClDecl tydecl@TyData {tcdND = new_or_data, tcdCtxt = context, else emptyFVs)) } where - h98_style = case condecls of - L _ (ConDecl { con_res = ResTyH98 }) : _ -> True - _ -> False + h98_style = case condecls of -- Note [Stupid theta] + L _ (ConDecl { con_res = ResTyGADT {} }) : _ -> False + _ -> True + data_doc = text "In the data type declaration for" <+> quotes (ppr tycon) rn_derivs Nothing = return (Nothing, emptyFVs) @@ -824,6 +825,15 @@ badGadtStupidTheta _ ptext (sLit "(You can put a context on each contructor, though.)")] \end{code} +Note [Stupid theta] +~~~~~~~~~~~~~~~~~~~ +Trac #3850 complains about a regression wrt 6.10 for + data Show a => T a +There is no reason not to allow the stupid theta if there are no data +constructors. It's still stupid, but does no harm, and I don't want +to cause programs to break unnecessarily (notably HList). So if there +are no data constructors we allow h98_style = True + %********************************************************* %* *