[commit: ghc] master: Add a failing test for #13102 (8f49f6d)
git at git.haskell.org
git at git.haskell.org
Tue Jan 24 03:45:21 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/8f49f6de2121541d3bf8254abb402b6e7bfee8fb/ghc
>---------------------------------------------------------------
commit 8f49f6de2121541d3bf8254abb402b6e7bfee8fb
Author: Reid Barton <rwbarton at gmail.com>
Date: Mon Jan 23 21:59:39 2017 -0500
Add a failing test for #13102
Test Plan: harbormaster
Reviewers: austin, ezyang, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D3005
GHC Trac Issues: #13102
>---------------------------------------------------------------
8f49f6de2121541d3bf8254abb402b6e7bfee8fb
testsuite/tests/indexed-types/should_fail/T13102/A.hs | 6 ++++++
testsuite/tests/indexed-types/should_fail/T13102/B.hs | 6 ++++++
testsuite/tests/indexed-types/should_fail/T13102/Makefile | 13 +++++++++++++
.../tests/indexed-types/should_fail/T13102/T13102.stderr | 11 +++++++++++
testsuite/tests/indexed-types/should_fail/T13102/all.T | 5 +++++
.../tests/indexed-types/should_fail/T13102/orphan/F.hs | 5 +++++
.../A.hs => indexed-types/should_fail/T13102/orphan/O.hs} | 7 +++++--
.../should_fail/T13102/orphan}/Setup.hs | 0
.../should_fail/T13102/orphan/orphan.cabal} | 4 ++--
9 files changed, 53 insertions(+), 4 deletions(-)
diff --git a/testsuite/tests/indexed-types/should_fail/T13102/A.hs b/testsuite/tests/indexed-types/should_fail/T13102/A.hs
new file mode 100644
index 0000000..7dd4348
--- /dev/null
+++ b/testsuite/tests/indexed-types/should_fail/T13102/A.hs
@@ -0,0 +1,6 @@
+module A where
+
+import O
+
+x _ = 1 -- Generate a silly warning, so we know A was really compiled
+x _ = 2 -- (and thus the reason B fails is that the bug is fixed)
diff --git a/testsuite/tests/indexed-types/should_fail/T13102/B.hs b/testsuite/tests/indexed-types/should_fail/T13102/B.hs
new file mode 100644
index 0000000..ab8832b
--- /dev/null
+++ b/testsuite/tests/indexed-types/should_fail/T13102/B.hs
@@ -0,0 +1,6 @@
+module B where
+
+import F
+
+f :: F Int -> Bool
+f = id
diff --git a/testsuite/tests/indexed-types/should_fail/T13102/Makefile b/testsuite/tests/indexed-types/should_fail/T13102/Makefile
new file mode 100644
index 0000000..b4cbff92
--- /dev/null
+++ b/testsuite/tests/indexed-types/should_fail/T13102/Makefile
@@ -0,0 +1,13 @@
+TOP=../../../..
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/test.mk
+
+LOCAL_PKGCONF=local.package.conf
+
+T13102:
+ "$(GHC_PKG)" init $(LOCAL_PKGCONF)
+ cd orphan && "$(TEST_HC)" -v0 --make Setup.hs
+ cd orphan && ./Setup configure -v0 --with-compiler="$(TEST_HC)" --with-hc-pkg="$(GHC_PKG)" --package-db=../$(LOCAL_PKGCONF)
+ cd orphan && ./Setup build -v0
+ cd orphan && ./Setup register -v0 --inplace
+ ! "$(TEST_HC)" $(TEST_HC_OPTS) -c A.hs B.hs -package-db $(LOCAL_PKGCONF)
diff --git a/testsuite/tests/indexed-types/should_fail/T13102/T13102.stderr b/testsuite/tests/indexed-types/should_fail/T13102/T13102.stderr
new file mode 100644
index 0000000..e884cba
--- /dev/null
+++ b/testsuite/tests/indexed-types/should_fail/T13102/T13102.stderr
@@ -0,0 +1,11 @@
+
+A.hs:6:1: warning: [-Woverlapping-patterns (in -Wdefault)]
+ Pattern match is redundant
+ In an equation for ‘x’: x _ = ...
+
+B.hs:6:5: error:
+ • Couldn't match type ‘F Int’ with ‘Bool’
+ Expected type: F Int -> Bool
+ Actual type: Bool -> Bool
+ • In the expression: id
+ In an equation for ‘f’: f = id
diff --git a/testsuite/tests/indexed-types/should_fail/T13102/all.T b/testsuite/tests/indexed-types/should_fail/T13102/all.T
new file mode 100644
index 0000000..bdde354
--- /dev/null
+++ b/testsuite/tests/indexed-types/should_fail/T13102/all.T
@@ -0,0 +1,5 @@
+# Test that we don't use a family instance that we didn't import
+
+test('T13102', [expect_broken(13102),
+ extra_files(['A.hs', 'B.hs', 'orphan'])],
+ run_command, ['$MAKE -s --no-print-directory T13102'])
diff --git a/testsuite/tests/indexed-types/should_fail/T13102/orphan/F.hs b/testsuite/tests/indexed-types/should_fail/T13102/orphan/F.hs
new file mode 100644
index 0000000..7e1ecf4
--- /dev/null
+++ b/testsuite/tests/indexed-types/should_fail/T13102/orphan/F.hs
@@ -0,0 +1,5 @@
+{-# LANGUAGE TypeFamilies #-}
+
+module F where
+
+type family F a :: *
diff --git a/testsuite/tests/driver/recomp016/A.hs b/testsuite/tests/indexed-types/should_fail/T13102/orphan/O.hs
similarity index 64%
copy from testsuite/tests/driver/recomp016/A.hs
copy to testsuite/tests/indexed-types/should_fail/T13102/orphan/O.hs
index 17a9dc0..b8608ec 100644
--- a/testsuite/tests/driver/recomp016/A.hs
+++ b/testsuite/tests/indexed-types/should_fail/T13102/orphan/O.hs
@@ -1,4 +1,7 @@
{-# LANGUAGE TypeFamilies #-}
-module A where
-type family F a
+
+module O where
+
+import F
+
type instance F Int = Bool
diff --git a/testsuite/tests/backpack/cabal/bkpcabal01/Setup.hs b/testsuite/tests/indexed-types/should_fail/T13102/orphan/Setup.hs
similarity index 100%
copy from testsuite/tests/backpack/cabal/bkpcabal01/Setup.hs
copy to testsuite/tests/indexed-types/should_fail/T13102/orphan/Setup.hs
diff --git a/testsuite/tests/cabal/cabal03/p/p.cabal b/testsuite/tests/indexed-types/should_fail/T13102/orphan/orphan.cabal
similarity index 59%
copy from testsuite/tests/cabal/cabal03/p/p.cabal
copy to testsuite/tests/indexed-types/should_fail/T13102/orphan/orphan.cabal
index 5ef93a0..c6a6ea0 100644
--- a/testsuite/tests/cabal/cabal03/p/p.cabal
+++ b/testsuite/tests/indexed-types/should_fail/T13102/orphan/orphan.cabal
@@ -1,5 +1,5 @@
-name: p
+name: orphan
version: 1.0
-exposed-modules: P
+exposed-modules: F, O
build-depends: base
build-type: Simple
More information about the ghc-commits
mailing list