Skip to content

GHC panic on type wildcard in left-hand side of data family

While playing around with data families I received the following output by ghc/ghci:

ghc: panic! (the 'impossible' happened)
  (GHC version 7.10.3 for x86_64-unknown-linux):
        rnHsTyKi HsWildcardTy

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

I had accidentally left a wildcard _ on the left-hand side of a data instance definition.

To reproduce enter the following code into a file and try to load that file into ghci, or try to compile it with ghc:

data family Bug x
data instance Bug _ = Bug

The expected behavior would be a (non-panic) error message of some sort.

Trac metadata
Trac field Value
Version 7.10.3
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