diff options
author | Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io> | 2020-01-16 20:03:27 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-02-09 02:52:27 -0500 |
commit | 1f630025d457807c4a9da513e4a0823e4643b2a6 (patch) | |
tree | 555b0cdce1f78935e9c39ec9efd06cb0b8dff4b3 | |
parent | 97d59db55e3b32861d91783c36d56e5c93f2cd19 (diff) | |
download | haskell-1f630025d457807c4a9da513e4a0823e4643b2a6.tar.gz |
Add a test for #15712
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T15712.hs | 18 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T15712.stderr | 6 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/all.T | 1 |
3 files changed, 25 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_fail/T15712.hs b/testsuite/tests/typecheck/should_fail/T15712.hs new file mode 100644 index 0000000000..a0b1d5f975 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T15712.hs @@ -0,0 +1,18 @@ +{-# Language RankNTypes #-} +{-# Language DerivingVia #-} +{-# Language DeriveFunctor #-} + +-- import Control.Monad.Codensity +import Data.Kind + +newtype Codensity f a = Codensity (forall xx. (a -> f xx) -> f xx) + deriving + (Functor) + +newtype GEndo m a = GEndo (m a -> m a) + +newtype LogicT m a = LogicT (forall xx. (a -> (m xx -> m xx)) -> (m xx -> m xx)) + deriving + (Functor) + via + (Codensity GEndo) diff --git a/testsuite/tests/typecheck/should_fail/T15712.stderr b/testsuite/tests/typecheck/should_fail/T15712.stderr new file mode 100644 index 0000000000..e8b5d397de --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T15712.stderr @@ -0,0 +1,6 @@ + +T15712.hs:18:16: error: + • Expecting one more argument to ‘GEndo’ + Expected kind ‘* -> *’, but ‘GEndo’ has kind ‘(* -> *) -> * -> *’ + • In the first argument of ‘Codensity’, namely ‘GEndo’ + In the newtype declaration for ‘LogicT’ diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index 156042cab1..e2496562e1 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -493,6 +493,7 @@ test('T15592a', normal, compile_fail, ['']) test('T15629', normal, compile_fail, ['']) test('T15767', normal, compile_fail, ['']) test('T15648', [extra_files(['T15648a.hs'])], multimod_compile_fail, ['T15648', '-v0 -fprint-equality-relations']) +test('T15712', normal, compile_fail, ['']) test('T15793', normal, compile_fail, ['']) test('T15796', normal, compile_fail, ['']) test('T15807', normal, compile_fail, ['']) |