apply-refact icon indicating copy to clipboard operation
apply-refact copied to clipboard

Refactor panics when running on haskell source files

Open flip111 opened this issue 2 years ago • 4 comments

» fd -g '*.hs' src app ps -x hlint --refactor --refactor-options="--inplace" {}
refactor: panic! (the 'impossible' happened)
  GHC version 9.4.7:
        runPipe

parse error on input `pattern'
Call stack:
    CallStack (from HasCallStack):
      callStackDoc, called at compiler/GHC/Utils/Panic.hs:182:37 in ghc:GHC.Utils.Panic
      pprPanic, called at src/Refact/Compat.hs:161:13 in main:Refact.Compat

Please report this as a GHC bug:  https://www.haskell.org/ghc/reportabug

flip111 avatar Dec 01 '23 16:12 flip111

I just encountered this too, did you ever find a fix?

TheOddler avatar Aug 05 '24 08:08 TheOddler

@TheOddler with which GHC version was refactor compiled in your case?

flip111 avatar Aug 05 '24 10:08 flip111

I'm not sure, but I have since found that using a newer version did solve my problem. I updated my nix channel I was using, and retried, and then it worked.

Sadly I'm not sure any more what the exact version of GHC was I was using, sorry!

TheOddler avatar Aug 05 '24 14:08 TheOddler

Can you narrow it down to the module or code block on which it panics?

zliu41 avatar Aug 11 '24 16:08 zliu41