[GHC] #12449: Broken types in identifiers bound by :print

GHC ghc-devs at haskell.org
Sun Jul 31 16:40:48 UTC 2016


#12449: Broken types in identifiers bound by :print
-------------------------------------+-------------------------------------
           Reporter:  mniip          |             Owner:
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.0.1
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  GHCi crash
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 {{{#!hs
 GHCi, version 8.0.1: http://www.haskell.org/ghc/  :? for help
 Prelude> :print show
 show = (_t1::Show a => a -> String)
 Prelude> :t _t1

 <interactive>:1:1: error:
     No instance for (Show a) arising from a use of ‘it’
 }}}
 Furthermore:
 {{{#!hs
 Prelude> _t1 "foo"

 <interactive>:3:5: error:ghc: panic! (the 'impossible' happened)
   (GHC version 8.0.1 for x86_64-unknown-linux):
         No skolem info: a_a1hz

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

 Prelude>
 }}}

 Enabling `-fprint-explicit-foralls`, I think, reveals the issue:
 {{{#!hs
 Prelude> :set -fprint-explicit-foralls
 Prelude> :print id
 id = (_t2::a1 -> a1)
 Prelude> :t id
 id :: forall {a}. a -> a
 Prelude> :t _t2
 _t2 :: a1 -> a1
 }}}

 Similar behavior albeit with a different panic message happens on 7.8.4
 and 7.10.3 as verified by bennofs over IRC:
 {{{
 GHCi, version 7.10.3: http://www.haskell.org/ghc/  :? for help
 Prelude> :print print
 print = (_t1::Show a => a -> IO ())
 Prelude> _t1
 ghc: panic! (the 'impossible' happened)
   (GHC version 7.10.3 for x86_64-unknown-linux):
         tcTyVarDetails a_apc

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

 7.6.3 doesn't exhibit this issue:
 {{{
 GHCi, version 7.6.3: http://www.haskell.org/ghc/  :? for help
 Prelude> :print id
 id = (_t1::forall a. a -> a)
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12449>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list