diff options
author | Ryan Scott <ryan.gl.scott@gmail.com> | 2021-11-08 19:11:58 -0500 |
---|---|---|
committer | Ryan Scott <ryan.gl.scott@gmail.com> | 2021-11-08 19:14:13 -0500 |
commit | d7865c4e9fa139d5ba7a40211c1de3e30db0c2f5 (patch) | |
tree | 266ffaf0c32c95c5c7f3f5294284defcba228bbe /compiler/GHC/Rename/Module.hs | |
parent | f8a98fd004769a0a0b700c34aee9df126797aa4b (diff) | |
download | haskell-wip/T20501.tar.gz |
Flesh out Note [The stupid context] and reference itwip/T20501
`Note [The stupid context]` in `GHC.Core.DataCon` talks about stupid contexts
from `DatatypeContexts`, but prior to this commit, it was rather outdated.
This commit spruces it up and references it from places where it is relevant.
Diffstat (limited to 'compiler/GHC/Rename/Module.hs')
-rw-r--r-- | compiler/GHC/Rename/Module.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/GHC/Rename/Module.hs b/compiler/GHC/Rename/Module.hs index bdb5a29e55..2febede5c5 100644 --- a/compiler/GHC/Rename/Module.hs +++ b/compiler/GHC/Rename/Module.hs @@ -1924,7 +1924,9 @@ rnDataDefn :: HsDocContext -> HsDataDefn GhcPs rnDataDefn doc (HsDataDefn { dd_ND = new_or_data, dd_cType = cType , dd_ctxt = context, dd_cons = condecls , dd_kindSig = m_sig, dd_derivs = derivs }) - = do { checkTc (h98_style || null (fromMaybeContext context)) + = do { -- DatatypeContexts (i.e., stupid contexts) can't be combined with + -- GADT syntax. See Note [The stupid context] in GHC.Core.DataCon. + checkTc (h98_style || null (fromMaybeContext context)) (badGadtStupidTheta doc) ; (m_sig', sig_fvs) <- case m_sig of |