[commit: testsuite] overlapping-tyfams: More test cases for closed families (1cad653)

Richard Eisenberg eir at cis.upenn.edu
Fri Jun 21 15:17:10 CEST 2013


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

On branch  : overlapping-tyfams

https://github.com/ghc/testsuite/commit/1cad653eed331831d8004ce2df7615b54bc04e50

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

commit 1cad653eed331831d8004ce2df7615b54bc04e50
Author: Richard Eisenberg <eir at cis.upenn.edu>
Date:   Wed Jun 19 23:43:45 2013 +0100

    More test cases for closed families

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

 tests/indexed-types/should_compile/Overlap14.hs |   12 ++++++++++++
 tests/indexed-types/should_compile/all.T        |    1 +
 tests/indexed-types/should_fail/NoGood.hs       |    5 +++++
 tests/indexed-types/should_fail/NoGood.stderr   |    5 +++++
 tests/indexed-types/should_fail/all.T           |    2 ++
 5 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/tests/indexed-types/should_compile/Overlap14.hs b/tests/indexed-types/should_compile/Overlap14.hs
new file mode 100644
index 0000000..49af37c
--- /dev/null
+++ b/tests/indexed-types/should_compile/Overlap14.hs
@@ -0,0 +1,12 @@
+{-# LANGUAGE TypeFamilies #-}
+
+module Overlap14 where
+
+type family F a b c where
+  F a a a   = Int
+  F Int b c = Bool
+
+type family G x
+
+foo :: F Int (G Bool) Bool
+foo = False
diff --git a/tests/indexed-types/should_compile/all.T b/tests/indexed-types/should_compile/all.T
index d8ff196..aadeda3 100644
--- a/tests/indexed-types/should_compile/all.T
+++ b/tests/indexed-types/should_compile/all.T
@@ -201,6 +201,7 @@ test('Overlap1', normal, compile, [''])
 test('Overlap2', normal, compile, [''])
 test('Overlap12', normal, compile, [''])
 test('Overlap13', normal, compile, [''])
+test('Overlap14', normal, compile, [''])
 test('T7156', normal, compile, [''])
 test('T5591a', normal, compile, [''])
 test('T5591b', normal, compile, [''])
diff --git a/tests/indexed-types/should_fail/NoGood.hs b/tests/indexed-types/should_fail/NoGood.hs
new file mode 100644
index 0000000..43a237b
--- /dev/null
+++ b/tests/indexed-types/should_fail/NoGood.hs
@@ -0,0 +1,5 @@
+{-# LANGUAGE TypeFamilies #-}
+
+type family F a b
+type instance F a a = Int
+type instance F [a] a = Bool
diff --git a/tests/indexed-types/should_fail/NoGood.stderr b/tests/indexed-types/should_fail/NoGood.stderr
new file mode 100644
index 0000000..bfb5814
--- /dev/null
+++ b/tests/indexed-types/should_fail/NoGood.stderr
@@ -0,0 +1,5 @@
+
+NoGood.hs:4:15:
+    Conflicting family instance declarations:
+      F a a -- Defined at NoGood.hs:4:15
+      F [a] a -- Defined at NoGood.hs:5:15
diff --git a/tests/indexed-types/should_fail/all.T b/tests/indexed-types/should_fail/all.T
index 5ee65d2..2ffab0c 100644
--- a/tests/indexed-types/should_fail/all.T
+++ b/tests/indexed-types/should_fail/all.T
@@ -96,3 +96,5 @@ test('T7536', normal, compile_fail, [''])
 test('T7729', normal, compile_fail, [''])
 test('T7729a', normal, compile_fail, [''])
 test('T7786', normal, compile_fail, [''])
+
+test('NoGood', normal, compile_fail, [''])





More information about the ghc-commits mailing list