[commit: testsuite] master: Test Trac #8518 (5ecd306)

git at git.haskell.org git at git.haskell.org
Tue Nov 12 15:07:55 UTC 2013


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/5ecd306e9420b0b4df3432c54555a183e8fe097d/testsuite

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

commit 5ecd306e9420b0b4df3432c54555a183e8fe097d
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Mon Nov 11 08:40:31 2013 +0000

    Test Trac #8518


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

5ecd306e9420b0b4df3432c54555a183e8fe097d
 tests/indexed-types/should_fail/T8518.hs     |   17 +++++++++++++++++
 tests/indexed-types/should_fail/T8518.stderr |   16 ++++++++++++++++
 tests/indexed-types/should_fail/all.T        |    2 ++
 3 files changed, 35 insertions(+)

diff --git a/tests/indexed-types/should_fail/T8518.hs b/tests/indexed-types/should_fail/T8518.hs
new file mode 100644
index 0000000..52d5440
--- /dev/null
+++ b/tests/indexed-types/should_fail/T8518.hs
@@ -0,0 +1,17 @@
+{-# LANGUAGE TypeFamilies #-}
+module T8518 where
+
+import Data.Maybe
+import Control.Applicative
+
+class Continuation c where
+    type Z c
+    type B c
+    type F c
+    continue ::  c -> (Z c) -> (B c) -> Maybe ((F c), c)
+
+callCont :: Continuation c => c -> (Z c) -> (B c) -> Maybe (F c)
+callCont c z b = rpt (4 :: Int) c z b
+    where
+        rpt 0 c' z' b' = fromJust (fst <$> (continue c' z' b'))
+        rpt i c' z' b' = let c'' = fromJust (snd <$> (continue c' z' b')) in rpt (i-1) c''
\ No newline at end of file
diff --git a/tests/indexed-types/should_fail/T8518.stderr b/tests/indexed-types/should_fail/T8518.stderr
new file mode 100644
index 0000000..e5ef99e
--- /dev/null
+++ b/tests/indexed-types/should_fail/T8518.stderr
@@ -0,0 +1,16 @@
+
+T8518.hs:17:78:
+    Could not deduce (F a1 ~ (Z a1 -> B a1 -> F a1))
+    from the context (Continuation c)
+      bound by the type signature for
+                 callCont :: Continuation c => c -> Z c -> B c -> Maybe (F c)
+      at T8518.hs:13:13-64
+    Relevant bindings include
+      c'' :: a1 (bound at T8518.hs:17:30)
+      b' :: B a1 (bound at T8518.hs:17:21)
+      z' :: Z a1 (bound at T8518.hs:17:18)
+      c' :: a1 (bound at T8518.hs:17:15)
+      rpt :: a -> a1 -> Z a1 -> B a1 -> F a1 (bound at T8518.hs:16:9)
+    In the expression: rpt (i - 1) c''
+    In the expression:
+      let c'' = fromJust (snd <$> (continue c' z' b')) in rpt (i - 1) c''
diff --git a/tests/indexed-types/should_fail/all.T b/tests/indexed-types/should_fail/all.T
index 6223bde..54a33cd 100644
--- a/tests/indexed-types/should_fail/all.T
+++ b/tests/indexed-types/should_fail/all.T
@@ -118,3 +118,5 @@ test('T8129',
 
 test('T8368', normal, compile_fail, [''])
 test('T8368a', normal, compile_fail, [''])
+test('T8518', normal, compile_fail, [''])
+



More information about the ghc-commits mailing list