diff options
author | sheaf <sam.derbyshire@gmail.com> | 2022-07-21 15:10:14 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-07-22 08:18:44 -0400 |
commit | a8b150e7809cbcd216963e0b3942b26722173f57 (patch) | |
tree | f316ebf7b3bdd510d1c23f21e9d2d6f697725990 /testsuite/tests | |
parent | 72dfad3dea54c003af88c8a5c0da57ce37216e9f (diff) | |
download | haskell-a8b150e7809cbcd216963e0b3942b26722173f57.tar.gz |
Add test for #21871
This adds a test for #21871, which was fixed by the No Skolem Info
rework (MR !7105).
Fixes #21871
Diffstat (limited to 'testsuite/tests')
-rw-r--r-- | testsuite/tests/deriving/should_fail/T21871.hs | 13 | ||||
-rw-r--r-- | testsuite/tests/deriving/should_fail/T21871.stderr | 9 | ||||
-rw-r--r-- | testsuite/tests/deriving/should_fail/all.T | 1 |
3 files changed, 23 insertions, 0 deletions
diff --git a/testsuite/tests/deriving/should_fail/T21871.hs b/testsuite/tests/deriving/should_fail/T21871.hs new file mode 100644 index 0000000000..83c56d696e --- /dev/null +++ b/testsuite/tests/deriving/should_fail/T21871.hs @@ -0,0 +1,13 @@ +{-# LANGUAGE DerivingVia, StandaloneDeriving #-} + +module T21871 where + +import Control.Monad.Trans.Reader + ( ReaderT(ReaderT) ) +import Data.Kind + ( Type ) + +newtype FooT m a = FooT + { runFooT :: Int -> m a + } + deriving Functor via ReaderT Int m diff --git a/testsuite/tests/deriving/should_fail/T21871.stderr b/testsuite/tests/deriving/should_fail/T21871.stderr new file mode 100644 index 0000000000..3ee6692bd6 --- /dev/null +++ b/testsuite/tests/deriving/should_fail/T21871.stderr @@ -0,0 +1,9 @@ + +T21871.hs:13:36: error: + • Couldn't match kind ‘k’ with ‘*’ + Expected kind ‘* -> *’, but ‘m’ has kind ‘k -> *’ + ‘k’ is a rigid type variable bound by + the newtype declaration for ‘FooT’ + at T21871.hs:(10,1)-(13,36) + • In the second argument of ‘ReaderT’, namely ‘m’ + In the newtype declaration for ‘FooT’ diff --git a/testsuite/tests/deriving/should_fail/all.T b/testsuite/tests/deriving/should_fail/all.T index 2b2f2af562..656e4dd5c2 100644 --- a/testsuite/tests/deriving/should_fail/all.T +++ b/testsuite/tests/deriving/should_fail/all.T @@ -83,3 +83,4 @@ test('deriving-via-fail5', normal, compile_fail, ['']) test('T21087', normal, compile_fail, ['']) test('T21087b', [extra_files(['T21087b_aux.hs','T21087b_aux.hs-boot'])], multimod_compile_fail, ['T21087b', '']) test('T21302', normal, compile_fail, ['']) +test('T21871', normal, compile_fail, ['']) |