
#13741: Newtype unwrapping causes GHC panic -------------------------------------+------------------------------------- Reporter: vaibhavsagar | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Resolution: | Keywords: newtype ghci Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Description changed by vaibhavsagar: @@ -19,0 +19,4 @@ + + Discovered + [https://www.reddit.com/r/haskell/comments/6clkgs/discovering_continuations_w... + here]. New description: 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 }}} Discovered [https://www.reddit.com/r/haskell/comments/6clkgs/discovering_continuations_w... here]. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13741#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler