summaryrefslogtreecommitdiff
path: root/testsuite/tests/indexed-types/should_fail
diff options
context:
space:
mode:
authorRichard Eisenberg <eir@seas.upenn.edu>2013-08-28 12:05:03 -0400
committerRichard Eisenberg <eir@cis.upenn.edu>2013-08-28 13:09:02 -0400
commita7bc138e3393b86ef4681410f17fdc7010909fe3 (patch)
tree37f520334f36ff38c105d47d0e0ac31bdfb2caf7 /testsuite/tests/indexed-types/should_fail
parente06abacd7b49ee5c675e4426535e921860c2bfbd (diff)
downloadhaskell-a7bc138e3393b86ef4681410f17fdc7010909fe3.tar.gz
Wibble to tests from improving comments about apartness.
Diffstat (limited to 'testsuite/tests/indexed-types/should_fail')
-rw-r--r--testsuite/tests/indexed-types/should_fail/Overlap15.hs16
-rw-r--r--testsuite/tests/indexed-types/should_fail/Overlap15.stderr7
-rw-r--r--testsuite/tests/indexed-types/should_fail/all.T1
3 files changed, 24 insertions, 0 deletions
diff --git a/testsuite/tests/indexed-types/should_fail/Overlap15.hs b/testsuite/tests/indexed-types/should_fail/Overlap15.hs
new file mode 100644
index 0000000000..c150a4028c
--- /dev/null
+++ b/testsuite/tests/indexed-types/should_fail/Overlap15.hs
@@ -0,0 +1,16 @@
+{-# LANGUAGE TypeFamilies #-}
+
+-- In an ideal world, this would work. But, GHC doesn't implement
+-- a full infinite-type unifier, so it can't figure out that F b [b] Bool
+-- can safely reduce to Bool.
+
+module Overlap15 where
+
+import Data.Proxy
+
+type family F a b c where
+ F a a a = Int
+ F b c Bool = Bool
+
+foo :: Proxy b -> F b [b] Bool
+foo _ = False
diff --git a/testsuite/tests/indexed-types/should_fail/Overlap15.stderr b/testsuite/tests/indexed-types/should_fail/Overlap15.stderr
new file mode 100644
index 0000000000..474bfd7983
--- /dev/null
+++ b/testsuite/tests/indexed-types/should_fail/Overlap15.stderr
@@ -0,0 +1,7 @@
+
+Overlap15.hs:16:9:
+ Couldn't match expected type ‛F b [b] Bool’ with actual type ‛Bool’
+ Relevant bindings include
+ foo :: Proxy * b -> F b [b] Bool (bound at Overlap15.hs:16:1)
+ In the expression: False
+ In an equation for ‛foo’: foo _ = False
diff --git a/testsuite/tests/indexed-types/should_fail/all.T b/testsuite/tests/indexed-types/should_fail/all.T
index 04d19abd16..14344da0bd 100644
--- a/testsuite/tests/indexed-types/should_fail/all.T
+++ b/testsuite/tests/indexed-types/should_fail/all.T
@@ -85,6 +85,7 @@ test('Overlap7', normal, compile_fail, [''])
test('Overlap9', normal, compile_fail, [''])
test('Overlap10', normal, compile_fail, [''])
test('Overlap11', normal, compile_fail, [''])
+test('Overlap15', normal, compile_fail, [''])
test('T7194', normal, compile_fail, [''])
test('T7354', normal, compile_fail, [''])
test('T7354a',