
#10176: Invalid core generated with GHC 7.10 RC3 -------------------------------------+------------------------------------- Reporter: NeilMitchell | Owner: Type: bug | Status: patch Priority: high | Milestone: 7.10.1 Component: Compiler | Version: 7.10.1-rc3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by NeilMitchell): To assess what does happen in this error case, I augmented the code to be: {{{ buggy fun unit bool = runReaderT (do if bool then liftReaderT $ print () else pure () if fun unit then do error2Args unit unit; liftReaderT $ print "here2" else pure () ) () :: IO () }}} Running {{{do print "here1"; buggy (const True) () True; print "here3"}}} gives {{{here1; here3}}}. GHC has used the presence of error to remove the {{{here2}}}, but since the code just falls out of the end of the function it returns back and still prints {{{here3}}}. That's a nasty result, and pretty much describes what happens in the full test case (I'm in the middle of compiling, and then suddenly I stop and do the thing that comes after compiling). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10176#comment:17 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler