X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fmain%2FTidyPgm.lhs;h=5c78927c7de8ddca8bda0a270b08a6e9b8b90077;hp=f7644f67eb47d479a190f6679822b1003047756b;hb=7bb3d1fc79521d591cd9f824893963141a7997b6;hpb=9ffadf219cbc4f8ec57264786df936a3cee88aec diff --git a/compiler/main/TidyPgm.lhs b/compiler/main/TidyPgm.lhs index f7644f6..5c78927 100644 --- a/compiler/main/TidyPgm.lhs +++ b/compiler/main/TidyPgm.lhs @@ -19,7 +19,8 @@ import CoreTidy import PprCore import CoreLint import CoreUtils -import Class ( classSelIds ) +import CoreArity ( exprArity ) +import Class ( classSelIds ) import VarEnv import VarSet import Var @@ -477,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 = + 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] @@ -547,7 +561,7 @@ addExternal (id,rhs) needed spec_ids idinfo = idInfo id - dont_inline = isNeverActive (inlinePragInfo idinfo) + dont_inline = isNeverActive (inlinePragmaActivation (inlinePragInfo idinfo)) loop_breaker = isNonRuleLoopBreaker (occInfo idinfo) bottoming_fn = isBottomingSig (newStrictnessInfo idinfo `orElse` topSig) spec_ids = specInfoFreeVars (specInfo idinfo)