summaryrefslogtreecommitdiff
path: root/compiler/rename
diff options
context:
space:
mode:
authorVladislav Zavialov <vlad.z.4096@gmail.com>2019-05-09 01:53:26 +0300
committerBen Gamari <ben@smart-cactus.org>2019-05-14 16:41:19 -0400
commita5fdd185188fcda595fd712f90864ec7c20cdace (patch)
treed5e2864ea5c798e0950b84b635942cdf380cc97a /compiler/rename
parentc72c369bcd56c74b745d90ee8f6acd12b430c65c (diff)
downloadhaskell-a5fdd185188fcda595fd712f90864ec7c20cdace.tar.gz
Guard CUSKs behind a language pragma
GHC Proposal #36 describes a transition plan away from CUSKs and to top-level kind signatures: 1. Introduce a new extension, -XCUSKs, on by default, that detects CUSKs as they currently exist. 2. We turn off the -XCUSKs extension in a few releases and remove it sometime thereafter. This patch implements phase 1 of this plan, introducing a new language extension to control whether CUSKs are enabled. When top-level kind signatures are implemented, we can transition to phase 2.
Diffstat (limited to 'compiler/rename')
-rw-r--r--compiler/rename/RnSource.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rename/RnSource.hs b/compiler/rename/RnSource.hs
index e7ff909c02..537f283183 100644
--- a/compiler/rename/RnSource.hs
+++ b/compiler/rename/RnSource.hs
@@ -1552,7 +1552,8 @@ rnTyClDecl (DataDecl { tcdLName = tycon, tcdTyVars = tyvars,
; bindHsQTyVars doc Nothing Nothing kvs tyvars $ \ tyvars' no_rhs_kvs ->
do { (defn', fvs) <- rnDataDefn doc defn
-- See Note [Complete user-supplied kind signatures] in HsDecls
- ; let cusk = hsTvbAllKinded tyvars' && no_rhs_kvs
+ ; cusks_enabled <- xoptM LangExt.CUSKs
+ ; let cusk = cusks_enabled && hsTvbAllKinded tyvars' && no_rhs_kvs
rn_info = DataDeclRn { tcdDataCusk = cusk
, tcdFVs = fvs }
; traceRn "rndata" (ppr tycon <+> ppr cusk <+> ppr no_rhs_kvs)