[commit: ghc] master: Refactor the way shadowing in handled in GHCi (5dffb4a)

git at git.haskell.org git at git.haskell.org
Fri Jan 3 16:14:44 UTC 2014


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/5dffb4ac14b53362ebe9a67c5c6a01f9c9c25229/ghc

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

commit 5dffb4ac14b53362ebe9a67c5c6a01f9c9c25229
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Fri Jan 3 15:50:39 2014 +0000

    Refactor the way shadowing in handled in GHCi
    
    If you say
      ghci> import Foo( T )
      ghci> data T = MkT
      ghci> data T = XXX
    then the second 'data T' should shadow the first.  But the qualified
    Foo.T should still be available.  We really weren't handling this
    correctly at all, resulting in Trac #8639 and #8628 among others
    
    This patch:
    
    * Add RdrName.extendGlobalRdrEnv, which does shadowing properly
    
    * Change HscTypes.icExtendGblRdrEnv (was badly-named icPlusGblRdrEnv)
      to use the new function
    
    * Change RnNames.extendGobalRdrEnvRn to use the new function
    
    * Move gresFrom Avails into RdrName
    * Better pprGlobalRdrEnv function in RdrName


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

5dffb4ac14b53362ebe9a67c5c6a01f9c9c25229
 compiler/basicTypes/Avail.hs     |   23 +---
 compiler/basicTypes/RdrName.lhs  |  233 +++++++++++++++++++++++++++-----------
 compiler/deSugar/DsMonad.lhs     |    1 -
 compiler/main/HscMain.hs         |    3 +-
 compiler/main/HscTypes.lhs       |   28 ++---
 compiler/main/InteractiveEval.hs |    2 +-
 compiler/rename/RnNames.lhs      |   41 ++++---
 compiler/rename/RnSource.lhs     |    1 +
 8 files changed, 209 insertions(+), 123 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 5dffb4ac14b53362ebe9a67c5c6a01f9c9c25229


More information about the ghc-commits mailing list