Skip to content

Type synonyms of promoted types break across library boundaries?

  1. Build a library/package consisting of the following module:
{-# LANGUAGE DataKinds #-}
module One where
data K = T
type T' = T
  1. Compile/interpret the following:
import One (T')
type DOne = T'
  1. GHC 7.4.1 says:
[1 of 1] Compiling Main             ( Two.hs, interpreted )
ghc: panic! (the 'impossible' happened)
  (GHC version 7.4.1 for x86_64-apple-darwin):
	tyThingTyCon Data constructor `tyThingTyCon-0.1:One.T{d r9H}'

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

It seems that GHC has problems with type synonyms for promoted types (DataKinds) loaded from another package. If the panicking code is loaded from the directory containing One.hs (i.e. One is compiled/interpreted at the same time) there is no panic.

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