[commit: ghc] master: Disable PVP warnings temporarily. (7666a9f)

git at git.haskell.org git at git.haskell.org
Mon Feb 13 04:13:51 UTC 2017


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/7666a9febae0a578aedabc49bcdc87d487b0e252/ghc

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

commit 7666a9febae0a578aedabc49bcdc87d487b0e252
Author: Edward Z. Yang <ezyang at cs.stanford.edu>
Date:   Fri Feb 10 23:15:30 2017 -0800

    Disable PVP warnings temporarily.
    
    While the intent is good, they are actually too aggressive:
    if a module reexports an identifier from a signature, we will
    warn (even though we should not!)  We'll have to implement
    this differently.
    
    Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu>


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

7666a9febae0a578aedabc49bcdc87d487b0e252
 compiler/typecheck/TcBackpack.hs                     | 12 ++++++++++--
 testsuite/tests/backpack/should_compile/bkp10.stderr |  4 ----
 testsuite/tests/backpack/should_compile/bkp11.stderr |  8 --------
 testsuite/tests/backpack/should_compile/bkp24.stderr |  4 ----
 testsuite/tests/backpack/should_compile/bkp36.stderr |  4 ----
 5 files changed, 10 insertions(+), 22 deletions(-)

diff --git a/compiler/typecheck/TcBackpack.hs b/compiler/typecheck/TcBackpack.hs
index fe17af5..cca40d8 100644
--- a/compiler/typecheck/TcBackpack.hs
+++ b/compiler/typecheck/TcBackpack.hs
@@ -16,7 +16,7 @@ module TcBackpack (
     instantiateSignature,
 ) where
 
-import BasicTypes (StringLiteral(..), SourceText(..), defaultFixity)
+import BasicTypes (defaultFixity)
 import Packages
 import TcRnExports
 import DynFlags
@@ -412,6 +412,7 @@ ifaceDeclNeverExportedRefs _ = []
 -- the wheels of recompilation avoidance which assumes that
 -- source files always exist.
 
+{-
 inheritedSigPvpWarning :: WarningTxt
 inheritedSigPvpWarning =
     WarningTxt (noLoc NoSourceText) [noLoc (StringLiteral NoSourceText (fsLit msg))]
@@ -421,6 +422,7 @@ inheritedSigPvpWarning =
           "compatible with PVP-style version bounds.  Instead, copy the " ++
           "declaration to the local hsig file or move the signature to a " ++
           "library of its own and add that library as a dependency."
+-}
 
 -- Note [Handling never-exported TyThings under Backpack]
 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -559,9 +561,15 @@ mergeSignatures hsmod lcl_iface0 = do
     let thinned_ifaces = reverse rev_thinned_ifaces
         exports        = nameShapeExports nsubst
         rdr_env        = mkGlobalRdrEnv (gresFromAvails Nothing exports)
-        warn_occs      = filter (not . (`elemOccSet` ok_to_use)) (exportOccs exports)
+        _warn_occs     = filter (not . (`elemOccSet` ok_to_use)) (exportOccs exports)
+        warns          = NoWarnings
+        {-
+        -- TODO: Warnings are transitive, but this is not what we want here:
+        -- if a module reexports an entity from a signature, that should be OK.
+        -- Not supported in current warning framework
         warns | null warn_occs = NoWarnings
               | otherwise = WarnSome $ map (\o -> (o, inheritedSigPvpWarning)) warn_occs
+        -}
     setGblEnv tcg_env {
         tcg_rdr_env = rdr_env,
         tcg_exports = exports,
diff --git a/testsuite/tests/backpack/should_compile/bkp10.stderr b/testsuite/tests/backpack/should_compile/bkp10.stderr
index 13c33f3..350670e 100644
--- a/testsuite/tests/backpack/should_compile/bkp10.stderr
+++ b/testsuite/tests/backpack/should_compile/bkp10.stderr
@@ -4,7 +4,3 @@
 [2 of 2] Processing q
   [1 of 2] Compiling H2[sig]          ( q/H2.hsig, nothing )
   [2 of 2] Compiling B                ( q/B.hs, nothing )
-
-bkp10.bkp:13:18: warning: [-Wdeprecations (in -Wdefault)]
-    In the use of type constructor or class ‘S’ (imported from H2):
-    "Inherited requirements from non-signature libraries (libraries with modules) should not be used, as this mode of use is not compatible with PVP-style version bounds.  Instead, copy the declaration to the local hsig file or move the signature to a library of its own and add that library as a dependency."
diff --git a/testsuite/tests/backpack/should_compile/bkp11.stderr b/testsuite/tests/backpack/should_compile/bkp11.stderr
index ca45b49..a804563 100644
--- a/testsuite/tests/backpack/should_compile/bkp11.stderr
+++ b/testsuite/tests/backpack/should_compile/bkp11.stderr
@@ -5,11 +5,3 @@
 [2 of 2] Processing q
   [1 of 2] Compiling H[sig]           ( q/H.hsig, nothing )
   [2 of 2] Compiling B                ( q/B.hs, nothing )
-
-bkp11.bkp:16:14: warning: [-Wdeprecations (in -Wdefault)]
-    In the use of type constructor or class ‘S’ (imported from H):
-    "Inherited requirements from non-signature libraries (libraries with modules) should not be used, as this mode of use is not compatible with PVP-style version bounds.  Instead, copy the declaration to the local hsig file or move the signature to a library of its own and add that library as a dependency."
-
-bkp11.bkp:16:19: warning: [-Wdeprecations (in -Wdefault)]
-    In the use of type constructor or class ‘T’ (imported from H):
-    "Inherited requirements from non-signature libraries (libraries with modules) should not be used, as this mode of use is not compatible with PVP-style version bounds.  Instead, copy the declaration to the local hsig file or move the signature to a library of its own and add that library as a dependency."
diff --git a/testsuite/tests/backpack/should_compile/bkp24.stderr b/testsuite/tests/backpack/should_compile/bkp24.stderr
index fbde703..ddafe41 100644
--- a/testsuite/tests/backpack/should_compile/bkp24.stderr
+++ b/testsuite/tests/backpack/should_compile/bkp24.stderr
@@ -11,10 +11,6 @@
 [4 of 5] Processing q
   [1 of 2] Compiling B[sig]           ( q/B.hsig, nothing )
   [2 of 2] Compiling Q                ( q/Q.hs, nothing )
-
-bkp24.bkp:23:24: warning: [-Wdeprecations (in -Wdefault)]
-    In the use of type constructor or class ‘B’ (imported from B):
-    "Inherited requirements from non-signature libraries (libraries with modules) should not be used, as this mode of use is not compatible with PVP-style version bounds.  Instead, copy the declaration to the local hsig file or move the signature to a library of its own and add that library as a dependency."
 [5 of 5] Processing r
   Instantiating r
   [1 of 2] Including q[B=b:B]
diff --git a/testsuite/tests/backpack/should_compile/bkp36.stderr b/testsuite/tests/backpack/should_compile/bkp36.stderr
index c891ab4..45ade14 100644
--- a/testsuite/tests/backpack/should_compile/bkp36.stderr
+++ b/testsuite/tests/backpack/should_compile/bkp36.stderr
@@ -7,7 +7,3 @@
 [3 of 3] Processing q
   [1 of 2] Compiling B[sig]           ( q/B.hsig, nothing )
   [2 of 2] Compiling Q                ( q/Q.hs, nothing )
-
-bkp36.bkp:20:16: warning: [-Wdeprecations (in -Wdefault)]
-    In the use of type constructor or class ‘T’ (imported from B):
-    "Inherited requirements from non-signature libraries (libraries with modules) should not be used, as this mode of use is not compatible with PVP-style version bounds.  Instead, copy the declaration to the local hsig file or move the signature to a library of its own and add that library as a dependency."



More information about the ghc-commits mailing list