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

GHC ghc-devs at haskell.org
Fri Dec 2 15:09:34 UTC 2016


#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


More information about the ghc-tickets mailing list