Skip to content
Snippets Groups Projects
Commit eecfacae authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Fix binder-swap bug

This patch fixes #21229 / #21470 properly, by avoiding doing a
binder-swap on dictionary Ids.  This is pretty subtle, and explained
in Note [Care with binder-swap on dictionaries].

This allows us to restore a feature to the specialiser that we had
to revert: see Note [Specialising polymorphic dictionaries].

I als modularised things, using a new function scrutBinderSwap_maybe
in all the places where we are (effectively) doing a binder-swap,
notably

* Simplify.Iteration.addAltUnfoldings
* SpecConstr.extendCaseBndrs

In Simplify.Iteration.addAltUnfoldings I also eliminated a guard
    Many <- idMult case_bndr
because we concluded, in #22123, that it was doing no good.
parent d5c07d40
No related branches found
No related tags found
No related merge requests found
Pipeline #57173 failed
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