Skip to content

GHC panic with DataKinds and TypeOperators

The following program causes a GHC panic:

{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE KindSignatures #-}
import GHC.TypeLits

data Proxy (n :: Nat) = Proxy

data Foo a = Foo a

foo :: Foo (Proxy (2 * 2))
foo = Foo _

The error message is:

ghc: panic! (the 'impossible' happened)
  (GHC version 8.0.2 for x86_64-unknown-linux):
        initTc: unsolved constraints
  WC {wc_insol = [W] __aBJ :: t_aBI[tau:1] (CHoleCan: _)}
Edited by turion
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information