Allow qualified names to be children in export lists
authorMatthew Pickering <matthewtpickering@gmail.com>
Wed, 12 Apr 2017 18:10:54 +0000 (14:10 -0400)
committerBen Gamari <ben@smart-cactus.org>
Wed, 12 Apr 2017 18:53:06 +0000 (14:53 -0400)
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

compiler/typecheck/TcRnExports.hs
testsuite/tests/module/T13528.hs [new file with mode: 0644]
testsuite/tests/module/all.T

index 3c0b8d3..b3d9317 100644 (file)
@@ -478,7 +478,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 (file)
index 0000000..60363eb
--- /dev/null
@@ -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(..))
index d7e6b74..6d05c77 100644 (file)
@@ -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, [''])
+