panic: refineFromInScope with -flate-specialize in 9.2.4
when building a project with ghc-9.2.4, stack-2.7.5, and
ghc-options:
"*" : -O2 -flate-specialise
I am getting this:
[1 of 1] Compiling Main
<no location info>: error:
ghc: panic! (the 'impossible' happened)
(GHC version 9.2.4:
refineFromInScope
...
eta_B2
Call stack:
CallStack (from HasCallStack):
callStackDoc, called at compiler/GHC/Utils/Panic.hs:181:37 in ghc:GHC.Utils.Panic
pprPanic, called at compiler/GHC/Core/Opt/Simplify/Env.hs:706:30 in ghc:GHC.Core.Opt.Simplify.Env
Please report this as a GHC bug: https://www.haskell.org/ghc/reportabug
...
Here is the full log of my reproducer: https://gitlab.imn.htwk-leipzig.de/waldmann/pure-matchbox/-/jobs/108448#L7526
I checked that the error goes away when I remove -flate-specialise
(but leave other options in).
The main module that is compiled is https://gitlab.imn.htwk-leipzig.de/waldmann/pure-matchbox/-/blob/master/improve-strategy.hs
If you think it's worthwile, then I can try to minimize.