summaryrefslogtreecommitdiff
path: root/compiler/GHC/Rename
diff options
context:
space:
mode:
authorRoland Senn <rsx@bluewin.ch>2020-02-17 10:58:32 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-02-20 21:21:28 -0500
commit8b76d4574d703ee66f346775d408220fdddb8155 (patch)
tree2db0fd5588029d788dc36dba42ab97b9ed468e82 /compiler/GHC/Rename
parent65b7256a88ae2bd878da5d026e4183cba6f6eedf (diff)
downloadhaskell-8b76d4574d703ee66f346775d408220fdddb8155.tar.gz
Fix #17832: Weird handling of exports named main in 8.10-rc1
Switching from `lookupGlobalOccRn_maybe` to `lookupInfoOccRn` to check whether a `main` function is in scope. Unfortunately `lookupGlobalOccRn_maybe` complains if there are multiple `main` functions in scope.
Diffstat (limited to 'compiler/GHC/Rename')
-rw-r--r--compiler/GHC/Rename/Env.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/GHC/Rename/Env.hs b/compiler/GHC/Rename/Env.hs
index 964b49412a..d300761a68 100644
--- a/compiler/GHC/Rename/Env.hs
+++ b/compiler/GHC/Rename/Env.hs
@@ -1062,6 +1062,9 @@ lookupInfoOccRn :: RdrName -> RnM [Name]
-- It finds all the GREs that RdrName could mean, not complaining
-- about ambiguity, but rather returning them all
-- C.f. #9881
+-- lookupInfoOccRn is also used in situations where we check for
+-- at least one definition of the RdrName, not complaining about
+-- multiple definitions. (See #17832)
lookupInfoOccRn rdr_name =
lookupExactOrOrig rdr_name (:[]) $
do { rdr_env <- getGlobalRdrEnv