[GHC] #13741: Newtype unwrapping causes GHC panic

GHC ghc-devs at haskell.org
Mon May 22 07:42:48 UTC 2017


#13741: Newtype unwrapping causes GHC panic
-------------------------------------+-------------------------------------
           Reporter:  vaibhavsagar   |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.0.2
           Keywords:  newtype ghci   |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 Some combination of newtypes and infix operators is causing GHCi to panic.

 Steps to reproduce:

 1. Open a fresh GHCi session.
 2. Define `Cont`: `newtype Cont a r = Cont {(>>-) :: (a -> r) -> r}`
 3. Define a `Functor` instance for `Cont`: `instance Functor (Cont r)
 where fmap f c = Cont $ \k -> c >>>- f . k`
 4. Observe the following:

 {{{
 ghc: panic! (the 'impossible' happened)
   (GHC version 8.0.2 for x86_64-unknown-linux):
         get_op >>>-

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

 }}}

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


More information about the ghc-tickets mailing list