Skip to content

Pattern Synonyms using other synonyms causes ghc panic

Here's a (somewhat) minimal example:

{-# LANGUAGE PatternSynonyms #-}

data Some = Thing Int Int


pattern A x = Thing x 0
pattern B x = Thing x 1
pattern C x = Thing x 2

pattern D = C 3

And here's what happened when I tried to load this into ghci:

*Main> :l ghc_bug.hs
[1 of 1] Compiling Main             ( ghc_bug.hs, interpreted )
ghc: panic! (the 'impossible' happened)
  (GHC version 8.0.1 for x86_64-unknown-linux):
        kindPrimRep.go rep_a3fP

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
Trac metadata
Trac field Value
Version 8.0.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information