[GHC] #9077: Forcing the type to be IO {} instead of IO() causes a "panic! The impossible has happened" output.

#9077: Forcing the type to be IO {} instead of IO() causes a "panic! The impossible has happened" output. -------------------------+------------------------------------------------- Reporter: | Owner: Westycoot | Status: new Type: bug | Milestone: Priority: | Version: 7.8.2 normal | Operating System: Unknown/Multiple Component: | Type of failure: Compile-time performance bug Compiler | Test Case: Keywords: | Blocking: Architecture: x86 | Difficulty: | Unknown | Blocked By: | Related Tickets: | -------------------------+------------------------------------------------- Below is the source code in which the bug occurs. It is easily reproduce- able, by having the type be IO{} instead of IO(). When ran, this code will produce the "panic! The impossible has happened" output. Which told me to report the bug here. By changing IO() to IO{} (which I did by accident), no exception is thrown, it simply tells the user to panic! {{{ main :: IO {} main = do e1 <- getLine e2 <- getLine print ((read e1) + (read e2)) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9077 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9077: Forcing the type to be IO {} instead of IO() causes a "panic! The impossible has happened" output. -------------------------------------------------+------------------------- Reporter: Westycoot | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86 Type of failure: Compile-time performance bug | Difficulty: Test Case: | Unknown Blocking: | Blocked By: | Related Tickets: -------------------------------------------------+------------------------- Comment (by simonpj): I can't reproduce your crash. Can you show exact output and which compiler you are using? Like this: {{{ bash$ ghc -c T9077.hs T9077.hs:3:12: Record syntax is illegal here: {} bash$ ghc --version The Glorious Glasgow Haskell Compilation System, version 7.8.2 bash$ cat T9077.hs module Main where main :: IO {} main = do e1 <- getLine e2 <- getLine print ((read e1) + (read e2)) }}} I speculate that you are not using 7.8.2. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9077#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9077: Forcing the type to be IO {} instead of IO() causes a "panic! The impossible has happened" output. -------------------------------------+------------------------------------- Reporter: Westycoot | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: worksforme | Keywords: Operating System: | Architecture: x86 Unknown/Multiple | Difficulty: Unknown Type of failure: Compile- | Blocked By: time performance bug | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by thomie): * status: new => closed * resolution: => worksforme Comment: GHC 7.6.3 indeed panics on the given example, but 7.8.3 does not. {{{ $ ghc-7.8.3 T9077.hs [1 of 1] Compiling Main ( T9077.hs, T9077.o ) T9077.hs:1:12: Record syntax is illegal here: {} }}} Westycoot: please reopen if you're still having problems. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9077#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9077: Forcing the type to be IO {} instead of IO() causes a "panic! The impossible has happened" output. -------------------------------------+------------------------------------- Reporter: Westycoot | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: worksforme | Keywords: Operating System: | Architecture: x86 Unknown/Multiple | Difficulty: Unknown Type of failure: Compile- | Blocked By: time performance bug | Related Tickets: Test Case: | rename/should_fail/T9077 | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by simonpj): * testcase: => rename/should_fail/T9077 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9077#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9077: Forcing the type to be IO {} instead of IO() causes a "panic! The
impossible has happened" output.
-------------------------------------+-------------------------------------
Reporter: Westycoot | Owner:
Type: bug | Status: closed
Priority: normal | Milestone:
Component: Compiler | Version: 7.8.2
Resolution: worksforme | Keywords:
Operating System: | Architecture: x86
Unknown/Multiple | Difficulty: Unknown
Type of failure: Compile- | Blocked By:
time performance bug | Related Tickets:
Test Case: |
rename/should_fail/T9077 |
Blocking: |
Differential Revisions: |
-------------------------------------+-------------------------------------
Comment (by Simon Peyton Jones
participants (1)
-
GHC