Abstract over the right free vars
Fix #22459, in two ways: (1) Make the Specialiser not create a bogus specialisation if it is presented by strangely polymorphic dictionary. See Note [Weird special case in SpecDict] in GHC.Core.Opt.Specialise (2) Be more careful in abstractFloats See Note [Which type variables to abstract over] in GHC.Core.Opt.Simplify.Utils. So (2) stops creating the excessively polymorphic dictionary in abstractFloats, while (1) stops crashing if some other pass should nevertheless create a weirdly polymorphic dictionary.
Showing
- compiler/GHC/Core/Opt/Simplify/Utils.hs 75 additions, 51 deletionscompiler/GHC/Core/Opt/Simplify/Utils.hs
- compiler/GHC/Core/Opt/Specialise.hs 33 additions, 0 deletionscompiler/GHC/Core/Opt/Specialise.hs
- compiler/GHC/Core/Subst.hs 10 additions, 2 deletionscompiler/GHC/Core/Subst.hs
- testsuite/tests/simplCore/should_compile/T22459.hs 23 additions, 0 deletionstestsuite/tests/simplCore/should_compile/T22459.hs
- testsuite/tests/simplCore/should_compile/all.T 1 addition, 0 deletionstestsuite/tests/simplCore/should_compile/all.T
Loading
-
mentioned in merge request !9535 (closed)
-
mentioned in issue #23972
Please register or sign in to comment