Commit dc9aa75e authored by Simon Peyton Jones's avatar Simon Peyton Jones Committed by Ben Gamari
Browse files

Don't do binder-swap for GlobalIds

This patch disables the binder-swap transformation in the
(relatively rare) case when the scrutinee is a GlobalId.
Reason: we are getting Lint errors so that GHC doesn't
even validate.  Trac #16346.

This is NOT the final solution -- it's just a stop-gap
to get us running again.

The final solution is in Trac #16296

(cherry picked from commit 0eb7cf03)
parent efe714d6
...@@ -2373,9 +2373,14 @@ mkAltEnv env@(OccEnv { occ_gbl_scrut = pe }) scrut case_bndr ...@@ -2373,9 +2373,14 @@ mkAltEnv env@(OccEnv { occ_gbl_scrut = pe }) scrut case_bndr
_ -> (env { occ_encl = OccVanilla }, Nothing) _ -> (env { occ_encl = OccVanilla }, Nothing)
where where
add_scrut v rhs = ( env { occ_encl = OccVanilla add_scrut v rhs
| isGlobalId v = (env { occ_encl = OccVanilla }, Nothing)
| otherwise = ( env { occ_encl = OccVanilla
, occ_gbl_scrut = pe `extendVarSet` v } , occ_gbl_scrut = pe `extendVarSet` v }
, Just (localise v, rhs) ) , Just (localise v, rhs) )
-- ToDO: this isGlobalId stuff is a TEMPORARY FIX
-- to avoid the binder-swap for GlobalIds
-- See Trac #16346
case_bndr' = Var (zapIdOccInfo case_bndr) case_bndr' = Var (zapIdOccInfo case_bndr)
-- See Note [Zap case binders in proxy bindings] -- See Note [Zap case binders in proxy bindings]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment