[Git][ghc/ghc][wip/T26831] Never eta-expand a naked variable!
Simon Peyton Jones pushed to branch wip/T26831 at Glasgow Haskell Compiler / GHC Commits: c49c255a by Simon Peyton Jones at 2026-02-13T11:03:20+00:00 Never eta-expand a naked variable! - - - - - 1 changed file: - compiler/GHC/CoreToStg/Prep.hs Changes: ===================================== compiler/GHC/CoreToStg/Prep.hs ===================================== @@ -1584,8 +1584,11 @@ eta_would_wreck_join _ = False maybeSaturate :: Id -> CpeApp -> Int -> [CoreTickish] -> UniqSM CpeRhs maybeSaturate fn expr n_args unsat_ticks | isJoinId fn -- Never eta-expand a call to a join point + -- See Note [Do not eta-expand join points] = return expr - | hasNoBinding fn || excess_arity > 0 + | hasNoBinding fn || (n_args > 0 && excess_arity > 0) + -- n_args > 0: do not eta-expand a naked variable! + -- excess_arity > 0: eta-expansion would be a no-op = return $ wrapLamBody (mkTicks unsat_ticks) sat_expr | otherwise = return expr View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c49c255a82ca89864270bd9adaa83f61... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c49c255a82ca89864270bd9adaa83f61... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Simon Peyton Jones (@simonpj)