shadowNames: Accept an OccName, not a GreName
previously, the shadowNames
function would take [GreName]
. This has
confused me for two reasons:
-
Why
GreName
and notName
? Does the difference between a normal name and a field name matter? The code ofshadowNames
shows that it does not, but really its better if the type signatures says so. -
Why
Name
and notOccName
? The point ofshadowNames
is to shadow unqualified names, at least in the two use cases I am aware of (names defined on the GHCI prompt or in TH splices).The code of
shadowNames
used to have cases that peek at the module of the given name and do something if that module appears in theGlobalRdrElt
, but I think these cases are dead code, I don’t see how they could occur in the above use cases. Also, I replaced them witherrors
and GHC would still validate. Hence removing this code (yay!)
This change also allows shadowNames
to accept an OccSet
instead,
which allows for a faster implemenation; I’ll try that separately. This
in stead might help with !6703 (closed).