[commit: ghc] ghc-8.2: Allow qualified names to be children in export lists (fd6b7f5)

git at git.haskell.org git at git.haskell.org
Tue Apr 18 03:11:04 UTC 2017


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

On branch  : ghc-8.2
Link       : http://ghc.haskell.org/trac/ghc/changeset/fd6b7f5619a17aca531e3d8908e36d5961beffd2/ghc

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

commit fd6b7f5619a17aca531e3d8908e36d5961beffd2
Author: Matthew Pickering <matthewtpickering at gmail.com>
Date:   Wed Apr 12 14:10:54 2017 -0400

    Allow qualified names to be children in export lists
    
    When doing this I noticed a horrible amount of duplication between
    lookupSubBndrOcc and lookupExportChild (which I am responsible for).
    I opened #13545 to keep track of this.
    
    Reviewers: austin, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: rwbarton, thomie
    
    GHC Trac Issues: #13528
    
    Differential Revision: https://phabricator.haskell.org/D3434
    
    (cherry picked from commit fa5a73f0a86908da31ec72ce33d37a7a704a0600)


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

fd6b7f5619a17aca531e3d8908e36d5961beffd2
 compiler/typecheck/TcRnExports.hs |  2 +-
 testsuite/tests/module/T13528.hs  | 13 +++++++++++++
 testsuite/tests/module/all.T      |  2 ++
 3 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/compiler/typecheck/TcRnExports.hs b/compiler/typecheck/TcRnExports.hs
index 35e30a7..322de93 100644
--- a/compiler/typecheck/TcRnExports.hs
+++ b/compiler/typecheck/TcRnExports.hs
@@ -475,7 +475,7 @@ lookupExportChild parent rdr_name
   | otherwise = do
   gre_env <- getGlobalRdrEnv
 
-  let original_gres = lookupGRE_RdrName rdr_name gre_env
+  let original_gres = lookupGlobalRdrEnv gre_env (rdrNameOcc rdr_name)
   -- Disambiguate the lookup based on the parent information.
   -- The remaining GREs are things that we *could* export here, note that
   -- this includes things which have `NoParent`. Those are sorted in
diff --git a/testsuite/tests/module/T13528.hs b/testsuite/tests/module/T13528.hs
new file mode 100644
index 0000000..60363eb
--- /dev/null
+++ b/testsuite/tests/module/T13528.hs
@@ -0,0 +1,13 @@
+{-# LANGUAGE NoImplicitPrelude #-}
+
+module T13528 (
+  GHC.Exts.IsList(
+      Item
+      , fromList
+      , toList
+      )
+  , Data.Bool.Bool(True, False)
+) where
+
+import qualified GHC.Exts (IsList(..))
+import qualified Data.Bool (Bool(..))
diff --git a/testsuite/tests/module/all.T b/testsuite/tests/module/all.T
index d7e6b74..6d05c77 100644
--- a/testsuite/tests/module/all.T
+++ b/testsuite/tests/module/all.T
@@ -282,3 +282,5 @@ test('T11970', normal, compile_fail, [''])
 test('T11970A', [], multimod_compile, ['T11970A','-Wunused-imports'])
 test('T11970B', normal, compile_fail, [''])
 test('MultiExport', normal, compile, [''])
+test('T13528', normal, compile, [''])
+



More information about the ghc-commits mailing list