[commit: testsuite] master: Test Trac #7558 (2593d45)

Simon Peyton Jones simonpj at microsoft.com
Thu Jun 20 12:00:05 CEST 2013


Repository : ssh://darcs.haskell.org//srv/darcs/testsuite

On branch  : master

https://github.com/ghc/testsuite/commit/2593d4524fecfca9e144f05588401741114b1270

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

commit 2593d4524fecfca9e144f05588401741114b1270
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Thu Jun 20 10:59:40 2013 +0100

    Test Trac #7558

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

 tests/gadt/T7558.hs     |    8 ++++++++
 tests/gadt/T7558.stderr |   13 +++++++++++++
 tests/gadt/all.T        |    1 +
 3 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/tests/gadt/T7558.hs b/tests/gadt/T7558.hs
new file mode 100644
index 0000000..129704f
--- /dev/null
+++ b/tests/gadt/T7558.hs
@@ -0,0 +1,8 @@
+{-# LANGUAGE GADTs #-}
+module T7558 where
+
+data T a b where
+  MkT :: (a~Maybe b) => a -> Maybe b -> T a b
+
+f :: T a a -> Bool
+f (MkT x y) = [x,y] `seq` True
diff --git a/tests/gadt/T7558.stderr b/tests/gadt/T7558.stderr
new file mode 100644
index 0000000..cf5d73d
--- /dev/null
+++ b/tests/gadt/T7558.stderr
@@ -0,0 +1,13 @@
+
+T7558.hs:8:4:
+    Couldn't match type ‛a’ with ‛Maybe a’
+      ‛a’ is a rigid type variable bound by
+          the type signature for f :: T a a -> Bool at T7558.hs:7:6
+    Inaccessible code in
+      a pattern with constructor
+        MkT :: forall a b. a ~ Maybe b => a -> Maybe b -> T a b,
+      in an equation for ‛f’
+    Relevant bindings include
+      f :: T a a -> Bool (bound at T7558.hs:8:1)
+    In the pattern: MkT x y
+    In an equation for ‛f’: f (MkT x y) = [x, y] `seq` True
diff --git a/tests/gadt/all.T b/tests/gadt/all.T
index e3e92df..1be8260 100644
--- a/tests/gadt/all.T
+++ b/tests/gadt/all.T
@@ -121,3 +121,4 @@ test('T7321',
      run_command,
      ['$MAKE -s --no-print-directory T7321'])
 test('T7974', normal, compile, [''])
+test('T7558', normal, compile_fail, [''])





More information about the ghc-commits mailing list