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

GHC ghc-devs at haskell.org
Fri Sep 18 10:09:10 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:
-------------------------------------+-------------------------------------

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 (by spl):

 Okay, I see that I missed the memo. The reasoning for removing {{{-X}}} is
 fine, and I'm glad the messages are consistent. I do think it would be
 useful to mention (language) extension (as opposed to using another flag)
 in the message, but the issue is minor and I'm not tied to it.

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


More information about the ghc-tickets mailing list