[commit: ghc] wip/orf-reboot: Don't addUsedRdrName for many ambiguous selectors at once (46d2fc2)

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


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

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

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

commit 46d2fc207da1001fca7569c5f438bba2342a0384
Author: Adam Gundry <adam at well-typed.com>
Date:   Wed Oct 7 11:41:05 2015 +0100

    Don't addUsedRdrName for many ambiguous selectors at once


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

46d2fc207da1001fca7569c5f438bba2342a0384
 compiler/rename/RnEnv.hs | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/compiler/rename/RnEnv.hs b/compiler/rename/RnEnv.hs
index fa49463..a75932d 100644
--- a/compiler/rename/RnEnv.hs
+++ b/compiler/rename/RnEnv.hs
@@ -875,8 +875,9 @@ lookupGlobalOccRn_overloaded overload_ok rdr_name
                          -> do { addUsedRdrName True gre rdr_name
                                ; return (Just (Left (gre_name gre))) }
                 gres  | all isRecFldGRE gres && overload_ok
-                         -> do { mapM_ (\ gre -> addUsedRdrName True gre rdr_name) gres
-                               ; return (Just (Right (map (FieldOcc rdr_name . gre_name) gres))) }
+                            -- Don't record usage for ambiguous selectors
+                            -- until we know which is meant
+                         -> return (Just (Right (map (FieldOcc rdr_name . gre_name) gres)))
                 gres     -> do { addNameClashErrRn rdr_name gres
                                ; return (Just (Left (gre_name (head gres)))) } }
 



More information about the ghc-commits mailing list