diff options
Diffstat (limited to 'testsuite/tests/quantified-constraints')
-rw-r--r-- | testsuite/tests/quantified-constraints/T15231.hs | 15 | ||||
-rw-r--r-- | testsuite/tests/quantified-constraints/T15231.stderr | 7 | ||||
-rw-r--r-- | testsuite/tests/quantified-constraints/all.T | 1 |
3 files changed, 23 insertions, 0 deletions
diff --git a/testsuite/tests/quantified-constraints/T15231.hs b/testsuite/tests/quantified-constraints/T15231.hs new file mode 100644 index 0000000000..7b7834d1f2 --- /dev/null +++ b/testsuite/tests/quantified-constraints/T15231.hs @@ -0,0 +1,15 @@ +{-# LANGUAGE ConstraintKinds #-} +{-# LANGUAGE GADTs #-} +{-# LANGUAGE KindSignatures #-} +{-# LANGUAGE QuantifiedConstraints #-} +module Bug where + +import Data.Kind + +data ECC :: Constraint -> Type -> Type + +class Y a +class Z a + +instance c => Y (ECC c a) +instance (c => Z a) => Z (ECC c a) diff --git a/testsuite/tests/quantified-constraints/T15231.stderr b/testsuite/tests/quantified-constraints/T15231.stderr new file mode 100644 index 0000000000..afb7ac3a25 --- /dev/null +++ b/testsuite/tests/quantified-constraints/T15231.stderr @@ -0,0 +1,7 @@ + +T15231.hs:15:10: error: + • Variable ‘c’ occurs more often + in the constraint ‘c’ than in the instance head ‘Z a’ + (Use UndecidableInstances to permit this) + • In the quantified constraint ‘c => Z a’ + In the instance declaration for ‘Z (ECC c a)’ diff --git a/testsuite/tests/quantified-constraints/all.T b/testsuite/tests/quantified-constraints/all.T index e546a7c495..75fcf8c772 100644 --- a/testsuite/tests/quantified-constraints/all.T +++ b/testsuite/tests/quantified-constraints/all.T @@ -9,3 +9,4 @@ test('T14863', normal, compile, ['']) test('T14961', normal, compile, ['']) test('T9123a', normal, compile, ['']) test('T15244', normal, compile, ['']) +test('T15231', normal, compile_fail, ['']) |