summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2016-06-29 10:41:55 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2016-06-29 10:42:11 +0100
commit2e9079ff2be2bbd65e399ef68b46439dbde04961 (patch)
tree6e4952a21fe1ccb3de06e5a70e68edd66df79c04
parentdd92c67be573604290560b93890ce4b8eccd40b3 (diff)
downloadhaskell-2e9079ff2be2bbd65e399ef68b46439dbde04961.tar.gz
Test Trac #12185
-rw-r--r--testsuite/tests/typecheck/should_compile/T12185.hs20
-rw-r--r--testsuite/tests/typecheck/should_compile/all.T1
2 files changed, 21 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_compile/T12185.hs b/testsuite/tests/typecheck/should_compile/T12185.hs
new file mode 100644
index 0000000000..d2007db87f
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T12185.hs
@@ -0,0 +1,20 @@
+{-# LANGUAGE FlexibleContexts, RankNTypes, TypeFamilies #-}
+
+module T12185 where
+
+class Foo a
+
+newtype Bar r = Pow r deriving (Eq)
+
+instance (Foo r) => Foo (Bar r)
+
+type family Ctx a where Ctx t = (Foo (Bar t), Eq (Bar t))
+
+run :: (forall t . (Ctx t) => t -> Int) -> Int
+run g = undefined
+
+foo :: (Foo (Bar t)) => t -> Int
+foo = undefined
+
+main :: IO ()
+main = print $ run foo
diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T
index 9843539747..33d91d1183 100644
--- a/testsuite/tests/typecheck/should_compile/all.T
+++ b/testsuite/tests/typecheck/should_compile/all.T
@@ -529,3 +529,4 @@ test('T11339d', normal, compile, [''])
test('T11974', normal, compile, [''])
test('T12067', extra_clean(['T12067a.hi', 'T12067a.o']),
multimod_compile, ['T12067', '-v0'])
+test('T12185', normal, compile, [''])