
#13591: "*** Exception: expectJust showModule" in ghci with hs-boot -------------------------------------+------------------------------------- Reporter: lspitzner | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 8.2.1-rc1 Keywords: ghci hs-boot | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- ghci runs into an exception if there is an error in Foo.hs when there exists a Foo.hs-boot (which compiles fine). - First.hs-boot {{{ module First where one :: Int }}} - Second.hs {{{ module Second where import {-# SOURCE #-} First two :: Int two = one + 1 }}} - First.hs {{{ module First where import Second one :: Int one = _ }}} {{{
ghci Prelude> :l First [1 of 3] Compiling First[boot] ( First.hs-boot, interpreted ) [2 of 3] Compiling Second ( Second.hs, interpreted ) [3 of 3] Compiling First ( First.hs, interpreted )
First.hs:6:7: error: • Found hole: _ :: Int • In the expression: _ In an equation for ‘one’: one = _ • Relevant bindings include one :: Int (bound at First.hs:6:1) *** Exception: expectJust showModule CallStack (from HasCallStack): error, called at compiler/utils/Maybes.hs:48:27 in ghc:Maybes }}} This happens on ghc-8.0.1, 8.0.2 and 8.2.1-rc1. The above output is from 8.0.2, but the error seems to be essentially the same on 8.2.1-rc1. It did not happen on 7.10.3. While ghci continues to work, the exception appears to clear the loaded- modules list, which in turn breaks tooling (ghcid here, which hangs as a consequence). The expected behaviour would be that other modules (which contain no errors) remain loaded. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13591 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler