Skip to content
Snippets Groups Projects
Commit 0f7dc670 authored by Ben Gamari's avatar Ben Gamari
Browse files

simplCore: Correctly extend in-scope set in rule matching

Note [Matching lets] in GHC.Core.Rules claims the following:

> We use GHC.Core.Subst.substBind to freshen the binding, using an
> in-scope set that is the original in-scope variables plus the
> rs_bndrs (currently floated let-bindings).

However, previously the implementation didn't actually do extend the
in-scope set with rs_bndrs. This appears to be a regression which was
introduced by 4ff4d434. Reintroduce
`rs_bndrs` into the in-scope set, ensuring that let-binders cannot
shadow one another due to rule rewrites.

Fixes #21122.
parent 464966ff
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment