• Simon Peyton Jones's avatar
    Refactor the way shadowing in handled in GHCi · 5dffb4ac
    Simon Peyton Jones authored
    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
    5dffb4ac
HscMain.hs 64.5 KB