[GHC] #10893: Consistent error message suggestions for using language extensions

GHC ghc-devs at haskell.org
Fri Sep 18 09:00:07 UTC 2015


#10893: Consistent error message suggestions for using language extensions
-------------------------------------+-------------------------------------
        Reporter:  spl               |                   Owner:
            Type:  feature request   |                  Status:  new
        Priority:  normal            |               Milestone:
       Component:  Compiler          |                 Version:  7.11
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:                    |  Differential Revisions:
-------------------------------------+-------------------------------------
Changes (by thomie):

 * cc: nomeata (added)


Old description:

> I saw this error today in 7.10.1:
>
> {{{
> Parse error: naked expression at top level
> Perhaps you intended to use TemplateHaskell
> }}}
>
> I'm glad it suggests using !TemplateHaskell; however, the suggestion
> seems incomplete. I did in fact intend to use Template Haskell, but I
> think this suggestion implies the ''language extension'' though it
> doesn't explicitly say so.
>
> I believe other error message suggestions are more explicit about
> mentioning language extension, e.g. {{{use -XFlexibleContexts}}}, which
> refers to the flag.
>
> I'm just bringing this issue up to request a consistent error message
> suggestion format for language extensions that explicitly mentions
> “language extension” or {{{-X}}}. (It may be that the above message is
> the only one not doing that; I haven't checked.)

New description:

 I saw this error today in 7.10.1:
 {{{
 Parse error: naked expression at top level
 Perhaps you intended to use TemplateHaskell
 }}}
 I'm glad it suggests using !TemplateHaskell; however, the suggestion seems
 incomplete. I did in fact intend to use Template Haskell, but I think this
 suggestion implies the ''language extension'' though it doesn't explicitly
 say so.
 I believe other error message suggestions are more explicit about
 mentioning language extension, e.g. {{{use -XFlexibleContexts}}}, which
 refers to the flag.
 I'm just bringing this issue up to request a consistent error message
 suggestion format for language extensions that explicitly mentions
 “language extension” or {{{-X}}}. (It may be that the above message is the
 only one not doing that; I haven't checked.)

--

Comment:

 See #3647 for why `-X` was removed from error messages.

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


More information about the ghc-tickets mailing list