GHC: Ticket #5802: GHC Panic with PolyKinds and TypeFamilies
http://ghc.haskell.org/trac/ghc/ticket/5802
<p>
The following crashes:
</p>
<pre class="wiki"> {-# LANGUAGE TypeOperators, PolyKinds, TypeFamilies, ExplicitForAll, GADTs #-}
module GHCBug where
data Nat = Zero | Succ Nat
data NatV (a :: Nat) where
ZeroV :: NatV Zero
SuccV :: NatV n -> NatV (Succ n)
data Phantom t = Whoo
data ListV (a :: [*]) where
NilV :: ListV '[]
(:::) :: Phantom a -> ListV as -> ListV (a ': as)
type family (:+:) (a :: Nat) (b :: Nat) :: Nat
type instance Zero :+: b = b
type instance (Succ a) :+: b = Succ (a :+: b)
type family TReplicate (n :: Nat) (t :: *) :: [*]
type instance TReplicate Zero t = '[]
type instance TReplicate (Succ n) t = t ': TReplicate n t
replicateTList :: forall (n :: Nat). forall t.
NatV n -> Phantom t -> ListV (TReplicate n t)
replicateTList ZeroV _ = NilV
replicateTList (SuccV n) t = t ::: replicateTList n t
</pre><p>
Potentially related to 5717 and 5768, although those two seem to be related to ScopedTypeVariables? They also seem to have a different panic message, although maybe this is because I'm using a debug-built GHC?
</p>
<p>
I'm not actually using 7.4.1-rc1, but 7.4 HEAD at the time of this writing.
</p>
en-usGHChttp://ghc.haskell.org/trac/ghc/chrome/site/ghc_logo.png
http://ghc.haskell.org/trac/ghc/ticket/5802
Trac 1.0.9iglooTue, 31 Jan 2012 22:29:24 GMTstatus changed; difficulty, resolution set
http://ghc.haskell.org/trac/ghc/ticket/5802#comment:1
http://ghc.haskell.org/trac/ghc/ticket/5802#comment:1
<ul>
<li><strong>status</strong>
changed from <em>new</em> to <em>closed</em>
</li>
<li><strong>difficulty</strong>
set to <em>Unknown</em>
</li>
<li><strong>resolution</strong>
set to <em>fixed</em>
</li>
</ul>
<p>
Thanks for the report. This seems fine to me in HEAD and 7.4 (if I change <tt>PolyKinds</tt> to <tt>DataKinds</tt>), so I assume it's been fixed. If you still think it's broken, can you please let us know exactly how you are compiling it and what error you are seeing?
</p>
Ticket