... | ... | @@ -39,7 +39,7 @@ re-exports all of `Foo`, plus `z`: |
|
|
import Foo( x, y ) import Foo( x, y )
|
|
|
bar = x + y bar = x + Bar.y
|
|
|
|
|
|
module X6 where module X7 whjre
|
|
|
module X6 where module X7 where
|
|
|
import Foo( x, y ) as Bar import FooPlus(x,y)
|
|
|
import Foo( x, y ) import FooPlus(y,z)
|
|
|
bar = Foo.x + Bar.y import FooPlus(z,x)
|
... | ... | @@ -98,7 +98,7 @@ More precisely: |
|
|
|
|
|
|
|
|
The import-item choosing step 2 implies that there is a total order on
|
|
|
import-items. We say import-item A ``dominates`` import-item B if we chooose
|
|
|
import-items. We say import-item A *dominates* import-item B if we choose
|
|
|
A over B. Here is one possible dominance relationship:
|
|
|
|
|
|
- `import Foo` dominates `import Foo(x)`. (You could also argue that the
|
... | ... | @@ -134,7 +134,7 @@ program. We must collect **`RdrNames`** not `Names`: |
|
|
|
|
|
|
|
|
Here both imports are required, but you can only tell that by
|
|
|
seeing the RdrNames, not by knowing that the name 'x' is used.
|
|
|
seeing the `RdrNames`, not by knowing that the name `x` is used.
|
|
|
|
|
|
|
|
|
I think that all lookups go through either, `RnEnv.lookupGreRn_maybe` or `RnEnv.lookup_sub_bndr`.
|
... | ... | @@ -159,11 +159,11 @@ Other notes |
|
|
|
|
|
- The unit of "unused import" reporting is one of these `ImportSpecs`.
|
|
|
|
|
|
- Suppose that 'rn' is a used, imported `RdrName`, and 'iss' is
|
|
|
- Suppose that `rn` is a used, imported `RdrName`, and `iss` is
|
|
|
the `[ImportSpecs]` that brought it into scope. Then, to a first
|
|
|
approximation all the iss are counted 'used'.
|
|
|
approximation all the `iss` are counted 'used'.
|
|
|
|
|
|
- We can compare `ImportSpecs` for equality by their `SrcSpans`
|
|
|
- We can compare `ImportSpecs` for equality by their `SrcSpans`.
|
|
|
|
|
|
- In `TcRnDriver.tcRnImports`, save import_decls in a new
|
|
|
`tcg_rn_rdr_imports :: Maybe [LImportDecl RdrName]`
|
... | ... | |