diff options
Diffstat (limited to 'compiler/hsSyn/Convert.lhs')
| -rw-r--r-- | compiler/hsSyn/Convert.lhs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/hsSyn/Convert.lhs b/compiler/hsSyn/Convert.lhs index 7a86c8180f..158a9c73d2 100644 --- a/compiler/hsSyn/Convert.lhs +++ b/compiler/hsSyn/Convert.lhs @@ -928,7 +928,8 @@ badOcc ctxt_ns occ <+> ptext (sLit "name:") <+> quotes (text occ) thRdrName :: OccName.NameSpace -> String -> TH.NameFlavour -> RdrName --- This turns a Name into a RdrName +-- This turns a TH Name into a RdrName; used for both binders and occurrences +-- See Note [Binders in Template Haskell] -- The passed-in name space tells what the context is expecting; -- use it unless the TH name knows what name-space it comes -- from, in which case use the latter @@ -1023,7 +1024,7 @@ a) We don't want to complain about "x" being bound twice in the pattern [x1,x2] b) We don't want x3 to shadow the x1,x2 c) We *do* want 'x' (dynamically bound with mkName) to bind - to the innermost binding of "x", namely x3.. (In this + to the innermost binding of "x", namely x3. d) When pretty printing, we want to print a unique with x1,x2 etc, else they'll all print as "x" which isn't very helpful @@ -1038,7 +1039,7 @@ Achieving (a) is a bit awkward, because RdrNames arising from TH and the Unqual RdrNames that would come from a user writing \[x,x] -> blah -So in Convert (here) we translate +So in Convert.thRdrName we translate TH Name RdrName -------------------------------------------------------- NameU (arising from newName) --> Exact (Name{ System }) @@ -1063,4 +1064,4 @@ So RnEnv.newGlobalBinder we spot Exact RdrNames that wrap a non-External Name, and make an External name for. (Remember, constructors and the like need External Names.) Oddly, the *occurrences* will continue to be that (non-External) System Name, -but that will come out in the wash. +but the first sweep of the optimiser will fix that. |
