[GHC] #12917: Location info for error message with multiple source locations

#12917: Location info for error message with multiple source locations -------------------------------------+------------------------------------- Reporter: gracjan | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Currently: {{{ MonadFailErrors.hs:16:5: error: • Could not deduce (MonadFail m) arising from a do statement with the failable pattern ‘Just x’ from the context: Monad m bound by the type signature for: general :: Monad m => m a at MonadFailErrors.hs:14:1-25 }}} better: {{{ MonadFailErrors.hs:16:5: error: • Could not deduce (MonadFail m) arising from a do statement with the failable pattern ‘Just x’ from the context: Monad m bound by the type signature for: general :: Monad m => m a MonadFailErrors.hs:14:1-25: defined here }}} Rationale: Code editors (Emacs) react to file paths and line numbers in the first column and provide affordances, like go to file after clicking. Related work: Similar mechanism is used by VisualStudio C compiler, gcc, clang. All location information is put in front, so that jump to source code works reliably. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12917 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12917: Location info for error message with multiple source locations -------------------------------------+------------------------------------- Reporter: gracjan | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by gracjan): This: {{{ MonadFailErrors.hs:44:5: error: • No instance for (MonadFail (ST s)) arising from a do statement with the failable pattern ‘Just x’ • In a stmt of a 'do' block: Just x <- undefined In the expression: do { Just x <- undefined; undefined } In an equation for ‘st’: st = do { Just x <- undefined; undefined } }}} Could be better described with: {{{ MonadFailErrors.hs:44:5-11: No instance for (MonadFail (ST s)) arising from a failable patter in a do statement }}} And count on Emacs to highlight relevant source code part, that is `Just x`. We could try to be more mouthful: {{{ MonadFailErrors.hs:44:5-11: No instance for (MonadFail (ST s)) arising from a failable patter in a do statement MonadFailErrors.hs:41:4: that begins here }}} but in this case this is overkill. In other cases it might be useful. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12917#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC