summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2015-02-19 23:14:17 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2015-02-20 08:49:58 +0000
commit10fab31211961c9200d230556ec7742e07a6c831 (patch)
treeb959d10c4850b0b4597133c2bea9d0c2ffa878c3 /testsuite
parent3f30912fcceceea68b8ea6ada6c3135447c6871a (diff)
downloadhaskell-10fab31211961c9200d230556ec7742e07a6c831.tar.gz
Don't report instance constraints with fundeps as redundant
More subtlety due to functional dependencies. Note [Redundant constraints in instance decls] in TcErrors. Fixes Trac #10100.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/typecheck/should_compile/T10100.hs13
-rw-r--r--testsuite/tests/typecheck/should_compile/all.T1
2 files changed, 14 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_compile/T10100.hs b/testsuite/tests/typecheck/should_compile/T10100.hs
new file mode 100644
index 0000000000..b88803c633
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T10100.hs
@@ -0,0 +1,13 @@
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE FunctionalDependencies #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE UndecidableInstances #-}
+
+module T10100 where
+
+data Zero
+data Succ a
+
+class Add a b ab | a b -> ab, a ab -> b
+instance Add Zero b b
+instance (Add a b ab) => Add (Succ a) b (Succ ab)
diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T
index b792629b42..c1ed5790b4 100644
--- a/testsuite/tests/typecheck/should_compile/all.T
+++ b/testsuite/tests/typecheck/should_compile/all.T
@@ -443,3 +443,4 @@ test('T9971', normal, compile, [''])
test('T9999', normal, compile, [''])
test('T10031', normal, compile, [''])
test('T10072', normal, compile_fail, [''])
+test('T10100', normal, compile, [''])