... | ... | @@ -103,7 +103,7 @@ With all that information, we can give good error messages, especially in the ca |
|
|
The global rdr-env is created by [compiler/rename/RnNames.lhs](/trac/ghc/browser/ghc/compiler/rename/RnNames.lhs).
|
|
|
|
|
|
|
|
|
It is important to note that the global rdr-env is created *before* the renamer actually descends into the top=level bindings of a module. In other words, before `TcRnDriver.rnTopSrcDecls` performs the renaming of a module by way of `RnSource.rnSrcDecls`, it uses `RnNames.importsFromLocalDecls` to set up the global rdr-env environment, which contains `Names` for all imported and all locally defined toplevel binders. Hence, when the helpers of `rnSrcDecls` come across the defining occurences of a toplevel `RdrName`, they don't rename it by generating a new name, but they simply look up its name in the global rdr-env.
|
|
|
It is important to note that the global rdr-env is created *before* the renamer actually descends into the top-level bindings of a module. In other words, before `TcRnDriver.rnTopSrcDecls` performs the renaming of a module by way of `RnSource.rnSrcDecls`, it uses `RnNames.importsFromLocalDecls` to set up the global rdr-env environment, which contains `Names` for all imported and all locally defined toplevel binders. Hence, when the helpers of `rnSrcDecls` come across the defining occurences of a toplevel `RdrName`, they don't rename it by generating a new name, but they simply look up its name in the global rdr-env.
|
|
|
|
|
|
## Unused imports
|
|
|
|
... | ... | |