[commit: ghc] wip/orf-reboot: Resurrect a failing report-unused-imports test (be204f0)

git at git.haskell.org git at git.haskell.org
Mon Oct 12 06:37:21 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/orf-reboot
Link       : http://ghc.haskell.org/trac/ghc/changeset/be204f0af9ef400d358eac77408aebfff4d44a3f/ghc

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

commit be204f0af9ef400d358eac77408aebfff4d44a3f
Author: Adam Gundry <adam at well-typed.com>
Date:   Tue Oct 6 16:42:39 2015 +0100

    Resurrect a failing report-unused-imports test


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

be204f0af9ef400d358eac77408aebfff4d44a3f
 .../should_fail/overloadedrecfldsfail06.hs                  | 13 ++++++++-----
 .../should_fail/overloadedrecfldsfail06.stderr              | 13 +++++++++++++
 2 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail06.hs b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail06.hs
index 9175c9e..249cb56 100644
--- a/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail06.hs
+++ b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail06.hs
@@ -4,12 +4,15 @@
 {-# LANGUAGE DuplicateRecordFields #-}
 {-# OPTIONS_GHC -Werror -fwarn-unused-imports #-}
 
-import OverloadedRecFldsFail06_A (U(MkU, x, y), V(MkV, MkV2, x, y), Unused(unused), u, getX, getY)
+import OverloadedRecFldsFail06_A (U(x, y), V(MkV, MkV2, x, y), Unused(unused), u, getY)
+import qualified OverloadedRecFldsFail06_A as M (U(x))
+import qualified OverloadedRecFldsFail06_A as N (V(x, y))
+import qualified OverloadedRecFldsFail06_A as P (U(x), V(x))
 
 v = MkV2 True
 
--- Check that this counts a use of U(x) and V(y) but not U(y) or V(x)
-main = do print (getX u)
-          print (getY v)
-          print ((\ MkU{x=x} -> x) u)
+-- Check that this counts a use of U(x) and V(y) but not U(y) or V(x)...
+main = do print (u { x = True } :: U)
           print ((\ MkV2{y=y} -> y) v)
+          print (N.x v)
+          print (getY (v { P.x = 3 }))
diff --git a/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail06.stderr b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail06.stderr
index 6339618..6a1b939 100644
--- a/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail06.stderr
+++ b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail06.stderr
@@ -14,5 +14,18 @@ overloadedrecfldsfail06.hs:7:1: warning:
     The import of ‘Unused(unused), V(x), U(y), MkV, Unused’
     from module ‘OverloadedRecFldsFail06_A’ is redundant
 
+overloadedrecfldsfail06.hs:8:1: warning:
+    The qualified import of ‘OverloadedRecFldsFail06_A’ is redundant
+      except perhaps to import instances from ‘OverloadedRecFldsFail06_A’
+    To import instances alone, use: import OverloadedRecFldsFail06_A()
+
+overloadedrecfldsfail06.hs:9:1: warning:
+    The qualified import of ‘V(y)’
+    from module ‘OverloadedRecFldsFail06_A’ is redundant
+
+overloadedrecfldsfail06.hs:10:1: warning:
+    The qualified import of ‘U(x), U’
+    from module ‘OverloadedRecFldsFail06_A’ is redundant
+
 <no location info>: error: 
 Failing due to -Werror.



More information about the ghc-commits mailing list