Skip to content

ghc: panic! when reloading file with code

Hello,

\\

  • *

This code:**

countSame :: (Ord a) => (a -> Bool) [a] -> Int
countSame _ [] = 0;
countSame p (x:s) = (if p x then 1 else 0) + (countSame p s) 

\\ (There is a mistake in header countSame :: (Ord a) => (a -> Bool) **#->#** [a] -> Int) \\

  • *gives me an error:**\\

''ghc: panic! (the 'impossible' happened)

(GHC version 8.2.1 for x86_64-unknown-linux):

repSplitAppTys

a_a6Xb[sk:1]

Bool

[]

Call stack:

CallStack (from HasCallStack):

prettyCurrentCallStack, called at compiler/utils/Outputable.hs:1133:58 in ghc:Outputable

callStackDoc, called at compiler/utils/Outputable.hs:1137:37 in ghc:Outputable

pprPanic, called at compiler/types/Type.hs:808:9 in ghc:Type''

\\

  • On some machines correctly recognized as broken header
  • I put this code in separate file and error still occurs so it should not have any dependencies.
  • (found on manjaro linux, ubuntu works OK. I have no other machines to compare)

I hope I found u a bug :) \\ Have a nice day

Edited by xvrbka1
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information