summaryrefslogtreecommitdiff
path: root/testsuite/tests/deriving
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2017-08-02 12:59:56 -0400
committerRyan Scott <ryan.gl.scott@gmail.com>2017-08-02 13:00:56 -0400
commitd74983ef0c4a5b47a53d2821f8be9ebbf86e9257 (patch)
treebd3f68548f19f7b06311e9435b9e181e1d17f8f8 /testsuite/tests/deriving
parent8ef852098286749af1165e1215204a5de63babaf (diff)
downloadhaskell-d74983ef0c4a5b47a53d2821f8be9ebbf86e9257.tar.gz
Get the roles right for newtype instances
This was a simple slip, that gave rise to the bug reported in comment:13 of Trac #14045. We were supplying roles to mkAlgTyCon that didn't match the tyvars.
Diffstat (limited to 'testsuite/tests/deriving')
-rw-r--r--testsuite/tests/deriving/should_compile/T14045b.hs13
-rw-r--r--testsuite/tests/deriving/should_compile/all.T1
2 files changed, 14 insertions, 0 deletions
diff --git a/testsuite/tests/deriving/should_compile/T14045b.hs b/testsuite/tests/deriving/should_compile/T14045b.hs
new file mode 100644
index 0000000000..cb18e36029
--- /dev/null
+++ b/testsuite/tests/deriving/should_compile/T14045b.hs
@@ -0,0 +1,13 @@
+{-# LANGUAGE TypeFamilies, KindSignatures, GADTs, GeneralizedNewtypeDeriving #-}
+
+module T14045b where
+
+import Data.Kind ( Type )
+
+data family T a b :: Type
+
+-- newtype instance T Int d = MkT (IO d)
+
+newtype instance T Int :: Type -> Type where
+ MkT :: IO d -> T Int d
+ deriving( Monad, Applicative, Functor )
diff --git a/testsuite/tests/deriving/should_compile/all.T b/testsuite/tests/deriving/should_compile/all.T
index 0025d25dee..5b69565c52 100644
--- a/testsuite/tests/deriving/should_compile/all.T
+++ b/testsuite/tests/deriving/should_compile/all.T
@@ -94,3 +94,4 @@ test('drv-phantom', [normalise_errmsg_fun(just_the_deriving)],compile, ['-ddump-
test('T13813', normal, compile, [''])
test('T13919', normal, compile, [''])
test('T13998', normal, compile, [''])
+test('T14045b', normal, compile, [''])