summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsimonpj@microsoft.com <unknown>2009-01-30 17:54:03 +0000
committersimonpj@microsoft.com <unknown>2009-01-30 17:54:03 +0000
commit97d5e75a63afc329096d94c74760415c586f7cec (patch)
tree23e4ec38dad35208ed89378b46b299597fb0f305
parentf21ba11b002791c909437abc589348c04ac441f1 (diff)
downloadhaskell-97d5e75a63afc329096d94c74760415c586f7cec.tar.gz
Comments about injecting implicit bindings
-rw-r--r--compiler/main/TidyPgm.lhs13
1 files changed, 13 insertions, 0 deletions
diff --git a/compiler/main/TidyPgm.lhs b/compiler/main/TidyPgm.lhs
index 869cc8f562..60fd7261ee 100644
--- a/compiler/main/TidyPgm.lhs
+++ b/compiler/main/TidyPgm.lhs
@@ -478,6 +478,19 @@ got the wrong arity -- ie the simplifier gave it arity 2, whereas
importing modules were expecting it to have arity 1 (Trac #2844).
It's much safer just to inject them right at the end, after tidying.
+Oh: two other reasons for injecting them late:
+ - If implicit Ids are already in the bindings when we start TidyPgm,
+ we'd have to be careful not to treat them as external Ids (in
+ the sense of findExternalIds); else the Ids mentioned in *their*
+ RHSs will be treated as external and you get an interface file
+ saying a18 = <blah>
+ but nothing refererring to a18 (because the implicit Id is the
+ one that does).
+
+ - More seriously, the tidied type-envt will include the implicit
+ Id replete with a18 in its unfolding; but we won't take account
+ of a18 when computing a fingerprint for the class; result chaos.
+
\begin{code}
getImplicitBinds :: TypeEnv -> [CoreBind]