Compiler panic when handling gap-looking string with escaping
Summary
Compiler panic when compiling interpolate test suite.
Building test suite 'spec' for interpolate-0.2.1...
[ 3 of 13] Compiling Data.String.Interpolate.Internal.UtilSpec ( test/Data/String/Interpolate/Internal/UtilSpec.hs, dist-newstyle/build/x86_64-linux/ghc-9.12.1/interpolate-0.2.1/t/spec/build/spec/spec-tmp/Data/String/Interpolate/Internal/UtilSpec.o ) [Source file changed]
<no location info>: error:
panic! (the 'impossible' happened)
GHC version 9.12.1:
gap unexpectedly ended
Please report this as a GHC bug: https://www.haskell.org/ghc/reportabug
Error: [Cabal-7125]
Failed to build test:spec from interpolate-0.2.1.
Steps to reproduce
The error comes from this line https://github.com/sol/interpolate/blob/a31cd1322665b10a6d901d6d70dd7bc35b71035d/test/Data/String/Interpolate/Internal/UtilSpec.hs#L75C41-L75C43
and can be isolated to
module Data.String.Interpolate.Internal.UtilSpec where
bug :: String
bug = "\^\ "
Expected behavior
Don't panic!
Environment
- GHC version used:
Observed on nixpkgs using 9.12.2 and then reproduced with cabal-install and 9.12.1