summaryrefslogtreecommitdiff
path: root/testsuite/tests
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 /testsuite/tests
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 'testsuite/tests')
-rw-r--r--testsuite/tests/driver/T4437.hs1
-rw-r--r--testsuite/tests/typecheck/should_fail/all.T1
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail225.hs9
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail225.stderr6
4 files changed, 17 insertions, 0 deletions
diff --git a/testsuite/tests/driver/T4437.hs b/testsuite/tests/driver/T4437.hs
index 2f28c05ec2..b8ef646a9b 100644
--- a/testsuite/tests/driver/T4437.hs
+++ b/testsuite/tests/driver/T4437.hs
@@ -41,6 +41,7 @@ expectedGhcOnlyExtensions = ["RelaxedLayout",
"AlternativeLayoutRuleTransitional",
"EmptyDataDeriving",
"GeneralisedNewtypeDeriving",
+ "CUSKs",
"ImportQualifiedPost"]
expectedCabalOnlyExtensions :: [String]
diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T
index c51398f00b..c4c5040b9b 100644
--- a/testsuite/tests/typecheck/should_fail/all.T
+++ b/testsuite/tests/typecheck/should_fail/all.T
@@ -241,6 +241,7 @@ test('tcfail217', normal, compile_fail, [''])
test('tcfail218', normal, compile_fail, [''])
test('tcfail223', normal, compile_fail, [''])
test('tcfail224', normal, compile_fail, [''])
+test('tcfail225', normal, compile_fail, [''])
test('SilentParametersOverlapping', normal, compile, [''])
test('FailDueToGivenOverlapping', normal, compile_fail, [''])
diff --git a/testsuite/tests/typecheck/should_fail/tcfail225.hs b/testsuite/tests/typecheck/should_fail/tcfail225.hs
new file mode 100644
index 0000000000..c01f49fdd1
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/tcfail225.hs
@@ -0,0 +1,9 @@
+{-# LANGUAGE PolyKinds, GADTs #-}
+{-# LANGUAGE NoCUSKs #-}
+
+module TcFail225 where
+
+import Data.Kind (Type)
+
+data T (m :: k -> Type) :: k -> Type where
+ MkT :: m a -> T Maybe (m a) -> T m a
diff --git a/testsuite/tests/typecheck/should_fail/tcfail225.stderr b/testsuite/tests/typecheck/should_fail/tcfail225.stderr
new file mode 100644
index 0000000000..5a3ba3681f
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/tcfail225.stderr
@@ -0,0 +1,6 @@
+
+tcfail225.hs:9:19: error:
+ • Expected kind ‘k -> *’, but ‘Maybe’ has kind ‘* -> *’
+ • In the first argument of ‘T’, namely ‘Maybe’
+ In the type ‘T Maybe (m a)’
+ In the definition of data constructor ‘MkT’