Skip to content

-XPolyKinds causes "*** Exception: Prelude.(!!): index too large"

The following program will compile fine:

{-# OPTIONS_GHC -Wall #-}
{-# Language DeriveFunctor #-}
--{-# Language PolyKinds #-}

module Bug where

data V a = V [a] deriving Functor

data C x a = C (V (P x a)) deriving Functor

data P x a = P (x a) deriving Functor

But when PolyKinds is enabled, GHC crashes with

$ ghc Bug.hs 
[1 of 1] Compiling Bug              ( Bug.hs, Bug.o )

Bug.hs:9:37:ghc: panic! (the 'impossible' happened)
  (GHC version 7.8.0.20140228 for x86_64-unknown-linux):
	Prelude.(!!): index too large
Trac metadata
Trac field Value
Version 7.8.1-rc2
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