Skip to content

segmentation fault/panic with -XTypeInType and functions of type * -> *

Since * :: *, I can specialize a function of type a -> a to type * -> *. This seems like potentially not a great idea, and GHCi agrees:

rwbarton@morphism:/tmp$ ~/ghc-newest/inplace/bin/ghc-stage2 --interactive
GHCi, version 7.11.20151228: http://www.haskell.org/ghc/  :? for help
Prelude> :set -XTypeInType 
Prelude> import Data.Kind
Prelude Data.Kind> :t id :: * -> *
id :: * -> * :: * -> *
Prelude Data.Kind> (id :: * -> *) undefined `seq` ()
Segmentation fault

Also, when compiling a module containing the above expression, I get a panic while producing Cmm:

rwbarton@morphism:/tmp$ ~/ghc-newest/inplace/bin/ghc-stage2 t
[1 of 1] Compiling Main             ( t.hs, t.o )
ghc-stage2: panic! (the 'impossible' happened)
  (GHC version 7.11.20151228 for x86_64-unknown-linux):
	idToReg sat_sKV
Trac metadata
Trac field Value
Version 7.11
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC goldfire
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information