diff options
author | Ryan Scott <ryan.gl.scott@gmail.com> | 2019-03-05 05:58:29 -0500 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-03-05 22:40:54 -0500 |
commit | db039a4a10fc8fa9e03e6781d1c0dc33151beda6 (patch) | |
tree | 2a13fa3cd93c001135fd73efa9be27315e3db1c3 /testsuite/tests/quantified-constraints | |
parent | c19a401db45148873a7b6ba575384d2e77807647 (diff) | |
download | haskell-db039a4a10fc8fa9e03e6781d1c0dc33151beda6.tar.gz |
Add regression test for #15918
The test case in #15918 no longer triggers an `ASSERT` failure on
GHC HEAD, likely due to commit
682783828275cca5fd8bf5be5b52054c75e0e22c (`Make a smart mkAppTyM`).
This patch adds a regression test for #15918 to finally put it to
rest.
Diffstat (limited to 'testsuite/tests/quantified-constraints')
-rw-r--r-- | testsuite/tests/quantified-constraints/T15918.hs | 19 | ||||
-rw-r--r-- | testsuite/tests/quantified-constraints/T15918.stderr | 7 | ||||
-rw-r--r-- | testsuite/tests/quantified-constraints/all.T | 1 |
3 files changed, 27 insertions, 0 deletions
diff --git a/testsuite/tests/quantified-constraints/T15918.hs b/testsuite/tests/quantified-constraints/T15918.hs new file mode 100644 index 0000000000..16e1e356d3 --- /dev/null +++ b/testsuite/tests/quantified-constraints/T15918.hs @@ -0,0 +1,19 @@ +{-# Language PolyKinds #-} +{-# Language TypeFamilies #-} +{-# Language ConstraintKinds #-} +{-# Language FlexibleContexts #-} +{-# Language QuantifiedConstraints #-} +{-# Language UndecidableInstances #-} +module T15918 where + +import Data.Kind + +class Rev f where + rev :: f a + +instance (forall xx. cls xx => Rev xx) => Rev (Build cls) where + rev = undefined + +data Build :: ((k -> Type) -> Constraint) -> (k -> Type) + +uu = rev :: Build [] a diff --git a/testsuite/tests/quantified-constraints/T15918.stderr b/testsuite/tests/quantified-constraints/T15918.stderr new file mode 100644 index 0000000000..fa06b0e3f4 --- /dev/null +++ b/testsuite/tests/quantified-constraints/T15918.stderr @@ -0,0 +1,7 @@ + +T15918.hs:19:19: error: + • Expected kind ‘(k0 -> *) -> Constraint’, + but ‘[]’ has kind ‘* -> *’ + • In the first argument of ‘Build’, namely ‘[]’ + In an expression type signature: Build [] a + In the expression: rev :: Build [] a diff --git a/testsuite/tests/quantified-constraints/all.T b/testsuite/tests/quantified-constraints/all.T index 1e2eca8358..da585823b2 100644 --- a/testsuite/tests/quantified-constraints/all.T +++ b/testsuite/tests/quantified-constraints/all.T @@ -20,3 +20,4 @@ test('T15359', normal, compile, ['']) test('T15359a', normal, compile, ['']) test('T15625', normal, compile, ['']) test('T15625a', normal, compile, ['']) +test('T15918', normal, compile_fail, ['']) |