[commit: ghc] master: Test Trac #10931 (6b7bad9)

git at git.haskell.org git at git.haskell.org
Mon Oct 12 16:06:06 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/6b7bad92c52d9cb0d17f75af1059315ddef0646e/ghc

>---------------------------------------------------------------

commit 6b7bad92c52d9cb0d17f75af1059315ddef0646e
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Tue Oct 6 12:43:10 2015 +0100

    Test Trac #10931


>---------------------------------------------------------------

6b7bad92c52d9cb0d17f75af1059315ddef0646e
 .../tests/indexed-types/should_compile/T10931.hs   | 25 ++++++++++++++++++++++
 testsuite/tests/indexed-types/should_compile/all.T |  1 +
 2 files changed, 26 insertions(+)

diff --git a/testsuite/tests/indexed-types/should_compile/T10931.hs b/testsuite/tests/indexed-types/should_compile/T10931.hs
new file mode 100644
index 0000000..2c0ea20
--- /dev/null
+++ b/testsuite/tests/indexed-types/should_compile/T10931.hs
@@ -0,0 +1,25 @@
+{-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE TypeFamilies #-}
+{-# LANGUAGE RankNTypes #-}
+
+{-# OPTIONS_GHC -Wall #-}
+
+module T10931 ( BugC(..) ) where
+
+data IdT f a = IdC (f a)
+
+class ( m ~ Outer m (Inner m) ) => BugC (m :: * -> *) where
+    type Inner m :: * -> *
+    type Outer m :: (* -> *) -> * -> *
+
+    bug :: ( forall n. ( n ~ Outer n (Inner n)
+                       , Outer n ~ Outer m
+                       )
+            => Inner n a)
+        -> m a
+
+instance BugC (IdT m) where
+    type Inner (IdT m) = m
+    type Outer (IdT m) = IdT
+
+    bug f = IdC f
diff --git a/testsuite/tests/indexed-types/should_compile/all.T b/testsuite/tests/indexed-types/should_compile/all.T
index b98f963..39b8a3a 100644
--- a/testsuite/tests/indexed-types/should_compile/all.T
+++ b/testsuite/tests/indexed-types/should_compile/all.T
@@ -264,3 +264,4 @@ test('T10713', normal, compile, [''])
 test('T10753', normal, compile, [''])
 test('T10806', normal, compile_fail, [''])
 test('T10815', normal, compile, [''])
+test('T10931', normal, compile, [''])



More information about the ghc-commits mailing list