Commit 0eb7cf03 authored by Simon Peyton Jones's avatar Simon Peyton Jones Committed by Matthew Pickering
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
parent a07f46ea
......@@ -2402,9 +2402,14 @@ mkAltEnv env@(OccEnv { occ_gbl_scrut = pe }) scrut case_bndr
_ -> (env { occ_encl = OccVanilla }, Nothing)
where
add_scrut v rhs = ( env { occ_encl = OccVanilla
, occ_gbl_scrut = pe `extendVarSet` v }
, Just (localise v, rhs) )
add_scrut v rhs
| isGlobalId v = (env { occ_encl = OccVanilla }, Nothing)
| otherwise = ( env { occ_encl = OccVanilla
, occ_gbl_scrut = pe `extendVarSet` v }
, 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)
-- 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