X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FsimplCore%2FSetLevels.lhs;h=6dfb5f1c051bbdfe622e24fa7a02a38430eed532;hb=fc867aa70e3bc8753287cf1f5e9a5adb05c38dc6;hp=225dea5bb4053add796a9716fafdd34461df8175;hpb=bb394e57361d9910b05f1145cbc894d33759d2a6;p=ghc-hetmet.git diff --git a/compiler/simplCore/SetLevels.lhs b/compiler/simplCore/SetLevels.lhs index 225dea5..6dfb5f1 100644 --- a/compiler/simplCore/SetLevels.lhs +++ b/compiler/simplCore/SetLevels.lhs @@ -771,8 +771,7 @@ absVarsOf dest_lvl (_, lvl_env, _, id_env) v Just (abs_vars, _) -> abs_vars Nothing -> [v] - add_tyvars v | isId v = v : varSetElems (idFreeTyVars v) - | otherwise = [v] + add_tyvars v = v : varSetElems (varTypeTyVars v) -- We are going to lambda-abstract, so nuke any IdInfo, -- and add the tyvars of the Id (if necessary) @@ -843,9 +842,11 @@ cloneRecVars NotTopLevel env@(_,_,subst,_) vs ctxt_lvl dest_lvl returnUs (env', vs2) -- VERY IMPORTANT: we must zap the demand info - -- if the thing is going to float out past a lambda + -- if the thing is going to float out past a lambda, + -- or if it's going to top level (where things can't be strict) zap_demand dest_lvl ctxt_lvl id - | ctxt_lvl == dest_lvl = id -- Stays put - | otherwise = zapDemandIdInfo id -- Floats out + | ctxt_lvl == dest_lvl, + not (isTopLvl dest_lvl) = id -- Stays, and not going to top level + | otherwise = zapDemandIdInfo id -- Floats out \end{code}