[GHC] #13741: Newtype unwrapping causes GHC panic

#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

#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

#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: @@ -6,1 +6,1 @@ - 2. Define `Cont`: `newtype Cont a r = Cont {(>>-) :: (a -> r) -> r}` + 2. Define `Cont`: `newtype Cont r a = Cont {(>>-) :: (a -> r) -> r}` 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 r a = 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:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13741: Newtype unwrapping causes GHC panic -------------------------------------+------------------------------------- Reporter: vaibhavsagar | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Resolution: duplicate | Keywords: newtype ghci Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #13132 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by mpickering): * status: new => closed * resolution: => duplicate * related: => #13132 Comment: See #13132 Fixed in 8.2.1. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13741#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC