[commit: testsuite] master: Test Trac #2247 (cdfefe8)

Simon Peyton Jones simonpj at microsoft.com
Thu Jan 24 14:59:43 CET 2013


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

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/cdfefe82bf47b53c3370f07e09458a208878edb6

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

commit cdfefe82bf47b53c3370f07e09458a208878edb6
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Thu Jan 24 13:59:26 2013 +0000

    Test Trac #2247

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

 tests/typecheck/should_fail/T2247.hs     |   18 ++++++++++++++++++
 tests/typecheck/should_fail/T2247.stderr |    6 ++++++
 tests/typecheck/should_fail/all.T        |    1 +
 3 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/tests/typecheck/should_fail/T2247.hs b/tests/typecheck/should_fail/T2247.hs
new file mode 100644
index 0000000..3779f2d
--- /dev/null
+++ b/tests/typecheck/should_fail/T2247.hs
@@ -0,0 +1,18 @@
+{-# LANGUAGE FunctionalDependencies, MultiParamTypeClasses, UndecidableInstances, FlexibleInstances #-}
+
+module T2247 where
+
+class FD a b | a -> b
+instance CFD a b => FD a b
+
+class {- FD a b => -} CFD a b
+instance CFD Bool Char
+instance CFD Bool Bool
+
+f' :: FD Bool Bool => Bool
+f' = True
+
+g' :: FD Bool Char => Bool
+g' = False
+
+x = f'
diff --git a/tests/typecheck/should_fail/T2247.stderr b/tests/typecheck/should_fail/T2247.stderr
new file mode 100644
index 0000000..70ef7f7
--- /dev/null
+++ b/tests/typecheck/should_fail/T2247.stderr
@@ -0,0 +1,6 @@
+
+T2247.hs:6:10:
+    Illegal instance declaration for `FD a b'
+      Multiple uses of this instance may be inconsistent
+      with the functional dependencies of the class.
+    In the instance declaration for `FD a b'
diff --git a/tests/typecheck/should_fail/all.T b/tests/typecheck/should_fail/all.T
index a4d0216..ad62ce7 100644
--- a/tests/typecheck/should_fail/all.T
+++ b/tests/typecheck/should_fail/all.T
@@ -293,3 +293,4 @@ test('T7525', normal, compile_fail, [''])
 test('T7368a', normal, compile_fail, [''])
 test('T7545', normal, compile_fail, [''])
 test('T7279', normal, compile_fail, [''])
+test('T2247', normal, compile_fail, [''])





More information about the ghc-commits mailing list