[GHC] #13899: Improve [-Wmissing-home-modules] error message

GHC ghc-devs at haskell.org
Thu Jun 29 21:49:13 UTC 2017


#13899: Improve [-Wmissing-home-modules] error message
-------------------------------------+-------------------------------------
        Reporter:  alanz             |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.2.1
       Component:  Compiler          |              Version:  8.2.1-rc2
      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 hvr):

 As `-Wmissing-home-modules` is a generic warning message we may want to
 avoid mentioning `other-extensions` unless we're actually building via
 Cabal. So here's an example from `GhcMake.hs` which changes the compiler
 message based on the presence of the `-fcabal-building-package` flag:

 {{{#!hs
             in throwOneError $ mkPlainErrMsg dflags' mod_loc $
                 text "Unexpected signature:" <+> quotes (ppr mod_name)
                 $$ if gopt Opt_BuildingCabalPackage dflags
                     then parens (text "Try adding" <+> quotes (ppr
 mod_name)
                             <+> text "to the"
                             <+> quotes (text "signatures")
                             <+> text "field in your Cabal file.")
                     else parens (text "Try passing -instantiated-with=\""
 <>
                                  suggested_instantiated_with <> text "\""
 $$
                                 text "replacing <" <> ppr mod_name <> text
 "> as necessary.")

 }}}

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


More information about the ghc-tickets mailing list