[commit: testsuite] master: Test Trac #7171 (b9e5bc2)
Simon Peyton Jones
simonpj at microsoft.com
Tue Aug 21 09:50:27 CEST 2012
Repository : ssh://darcs.haskell.org//srv/darcs/testsuite
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/b9e5bc2129abfb16905e3c208af6c4e0ea816de8
>---------------------------------------------------------------
commit b9e5bc2129abfb16905e3c208af6c4e0ea816de8
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Tue Aug 21 08:49:42 2012 +0100
Test Trac #7171
>---------------------------------------------------------------
tests/typecheck/should_compile/Makefile | 6 ++++++
tests/typecheck/should_compile/T7171.hs | 14 ++++++++++++++
tests/typecheck/should_compile/T7171a.hs | 18 ++++++++++++++++++
tests/typecheck/should_compile/all.T | 2 ++
4 files changed, 40 insertions(+), 0 deletions(-)
diff --git a/tests/typecheck/should_compile/Makefile b/tests/typecheck/should_compile/Makefile
index 36e924a..518f923 100644
--- a/tests/typecheck/should_compile/Makefile
+++ b/tests/typecheck/should_compile/Makefile
@@ -30,3 +30,9 @@ T5792:
$(RM) -f T5792.o T5792.hi
'$(TEST_HC)' -c T5792.hs
'$(TEST_HC)' -c T5792.hs -fforce-recomp
+
+T7171:
+ $(RM) -f T7171.hi-boot T7171.o-boot T7171a.hi T7171a.o
+ '$(TEST_HC)' $(TEST_HC_OPTS) -c T7171a.hs
+ '$(TEST_HC)' $(TEST_HC_OPTS) -c T7171.hs
+
diff --git a/tests/typecheck/should_compile/T7171.hs b/tests/typecheck/should_compile/T7171.hs
new file mode 100644
index 0000000..0f19337
--- /dev/null
+++ b/tests/typecheck/should_compile/T7171.hs
@@ -0,0 +1,14 @@
+{-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE FlexibleInstances #-}
+
+module T7171 where
+
+import T7171a
+import Data.ByteString
+
+-- this works
+-- test1 :: [Int] -> [Int]
+-- test1 = test
+
+-- this fails
+test2 :: ByteString -> ByteString
+test2 = test
diff --git a/tests/typecheck/should_compile/T7171a.hs b/tests/typecheck/should_compile/T7171a.hs
new file mode 100644
index 0000000..c2d7ec9
--- /dev/null
+++ b/tests/typecheck/should_compile/T7171a.hs
@@ -0,0 +1,18 @@
+{-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE FlexibleInstances #-}
+
+module T7171a where
+
+import Data.ByteString as B
+import Data.Word
+
+class Foo a b | a -> b
+
+class (Foo a b) => Bar a b | a -> b
+
+instance Foo [a] a
+instance Bar [a] a
+instance Foo ByteString Word8
+instance Bar ByteString Word8
+
+test :: Bar full item => full -> full
+test inp = inp
diff --git a/tests/typecheck/should_compile/all.T b/tests/typecheck/should_compile/all.T
index 54b04ca..6b9aa4e 100644
--- a/tests/typecheck/should_compile/all.T
+++ b/tests/typecheck/should_compile/all.T
@@ -382,3 +382,5 @@ test('DfltProb2', normal, compile, [''])
test('T6134', normal, compile, [''])
test('TcLambdaCase', if_compiler_lt('ghc', '7.5', skip), compile, [''])
test('T7147', normal, compile, [''])
+test('T7171',normal,run_command,
+ ['$MAKE -s --no-print-directory T5792'])
More information about the Cvs-ghc
mailing list