Skip to content

GHCi 8.0.1 panic with PatternSynonyms

Loading this code:

{-# LANGUAGE PatternSynonyms #-}

data D1 = MkD1 ()
data D2 = MkD2 D1

pattern P1 x = MkD1 x
pattern P2 x = MkD2 (P1 x)

in GHCi 8.0.1 results in the following panic:

$ ghci Broken.hs         
GHCi, version 8.0.1: http://www.haskell.org/ghc/  :? for help
[1 of 1] Compiling Main             ( Broken.hs, interpreted )
ghc: panic! (the 'impossible' happened)
  (GHC version 8.0.1 for x86_64-unknown-linux):
	kindPrimRep.go rep_a18s

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

> 

The unique name in the error message (rep_a18s) seems to be consistent between executions, but varies after :reloading.

The panic does not occur when the module is simply compiled with ghc; it only occurs when loaded into ghci.

According to ​Gergő Érdi, who is CCed, the error does not occur in GHCi 7.10.3

Trac metadata
Trac field Value
Version 8.0.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component GHCi
Test case
Differential revisions
BlockedBy
Related
Blocking
CC cactus
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information