Skip to content

Panic in GHCi when using :print

When using names generated by :print, GHCi panics sometimes. According to #ghc, this is reproducible on x86_64-apple-darwin as well, but is not an issue in 7.6.3 x86_64 linux.

> let a = [1]

> :print a
a = (_t1::Num t => [t])

> :t _t1
ghc: panic! (the 'impossible' happened)
  (GHC version 7.8.2 for x86_64-unknown-linux):
	tcTyVarDetails t{tv avD} [tv]

> _t1
<same panic>

From playing around with it a bit, this seems to have something to do with polymorphic values.

-- No panic
> let a = [1 :: Int]
> let a = 1 :: Int
> let a = "hello"

-- Panic
> let a = [1]
> let a = 1
> let a = "hello" -- With -XOverloadedStrings
Trac metadata
Trac field Value
Version 7.8.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component GHCi
Test case
Differential revisions
BlockedBy
Related
Blocking
CC hvr
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information