Commit dafabe65 authored by simonpj@microsoft.com's avatar simonpj@microsoft.com
Browse files

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].
parent a3b40c7d
......@@ -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
%*********************************************************
%* *
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment