
#9693: Reloading GHCi with Template Haskell names can panic GHC -------------------------------------+------------------------------------- Reporter: maxs | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Template | Version: 7.8.3 Haskell | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: GHC | Related Tickets: rejects valid program | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by thomie): * status: infoneeded => new * component: Compiler => Template Haskell Comment: I am able to reproduce with 7.8.3 and recent HEAD, on Linux, following these steps: * ghci thbug.hs * ignore the error * comment out the newName, uncomment the mkName in Fun.hs * :r This is the result: {{{ $ ghc-7.9.20141108 --interactive thbug.hs GHCi, version 7.9.20141108: http://www.haskell.org/ghc/ :? for help [1 of 2] Compiling Fun ( Fun.hs, interpreted ) [2 of 2] Compiling Main ( thbug.hs, interpreted ) thbug.hs:4:1: Duplicate exact Name ‘X’ Probable cause: you used a unique Template Haskell name (NameU), perhaps via newName, but bound it multiple times If that's it, then -ddump-splices might be useful Failed, modules loaded: Fun. ... Comment out the newName, uncomment the mkName in Fun.hs. ... *Fun> :r [1 of 2] Compiling Fun ( Fun.hs, interpreted ) [2 of 2] Compiling Main ( thbug.hs, interpreted ) ghc: panic! (the 'impossible' happened) (GHC version 7.9.20141108 for x86_64-unknown-linux): kcLookupKind APromotionErr RecDataConPE }}} So the first 'duplicate exact name X' error leaves GHCi in some inconsistent state. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9693#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler