[GHC] #15326: Add option to disable error message expression context (the 'In the expression' things)

GHC ghc-devs at haskell.org
Sat Jun 30 16:29:00 UTC 2018


#15326: Add option to disable error message expression context (the 'In the
expression' things)
-------------------------------------+-------------------------------------
           Reporter:  dramforever    |             Owner:  (none)
               Type:  feature        |            Status:  new
  request                            |
           Priority:  normal         |         Milestone:  8.6.1
          Component:  Compiler       |           Version:  8.4.3
           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:
-------------------------------------+-------------------------------------
 A typical error looks like this:

 {{{
 bug.hs:17:7: warning: [-Wdeferred-type-errors]
     ? No instance for (PolyList t0 [Integer])
         arising from a use of ‘polyList’
     ? In the expression: polyList 1 2 3 4 5
       In an equation for ‘plh’: plh = polyList 1 2 3 4 5
    |
 17 | plh = polyList 1 2 3 4 5
    |       ^^^^^^^^^^^^^^^^^^
 }}}

 Note the two lines starting with `In`. They waste two lines of error
 message space and now provides near zero utility since:

 1. There's a caret view right below that context.
 2. There are editor integrations that show squiggles right in the editor.

 Now we have an option `-f[no-]diagnostics-show-caret` that disables the
 caret. It would be great to have one that disables those code context
 lines too.

 As for naming. I'm thinking about `-f[no-]diagnostics-show-context`, which
 may be confused with constraint contexts, and `-f[no-]diagnostics-show-
 code-context`, which is a bit too long. I don't really know what those
 context lines are properly called, so maybe someone can come up with a
 more precise one.

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15326>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list