[GHC] #16075: Weverything ignores some OPTIONS_GHC flags
GHC
ghc-devs at haskell.org
Mon Feb 4 19:36:40 UTC 2019
#16075: Weverything ignores some OPTIONS_GHC flags
-------------------------------------+-------------------------------------
Reporter: crockeea | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.6.2
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: Incorrect | Unknown/Multiple
error/warning at compile-time | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Description changed by bgamari:
Old description:
> When I enable `-Weverything`, some `OPTIONS_GHC` pragmas are respected,
> while others are ignored. For example, with `-Weverything`, this file
>
> {{{
> main = print "hello"
>
> foo :: (Num a, Show a) => a -> IO ()
> foo = print . show
> }}}
>
> generates warnings about:
>
> 1. missing an export list
> 2. top-level binding [main] with no type sig
> 3. redundant constraint [Num a]
>
> If I add `{-# OPTIONS_GHC -fno-warn-missing-signatures -fno-warn-missing-
> export-lists -fno-warn-redundant-constraints #-}` to the top of the file
> and recompile, I expect all warnings to go away. But GHC still reports
> that `main` has no signature.
>
> Note that this problem doesn't occur with `-Wall`. With `-Wall`, the code
> snippet warns about the missing signature on `main`, but when I add the
> `OPTIONS_GHC`, the warning goes away. Thus this problem appears to be
> unique to `Weverything`.
New description:
When I enable `-Weverything`, some `OPTIONS_GHC` pragmas are respected,
while others are ignored. For example, with `-Weverything`, this file
{{{
main = print "hello"
foo :: (Num a, Show a) => a -> IO ()
foo = print . show
}}}
generates warnings about:
1. missing an export list
2. top-level binding [main] with no type sig
3. redundant constraint [Num a]
If I add `{-# OPTIONS_GHC -fno-warn-missing-signatures -fno-warn-missing-
export-lists -fno-warn-redundant-constraints #-}` to the top of the file
and recompile, I expect all warnings to go away. But GHC still reports
that `main` has no signature.
Note that this problem doesn't occur with `-Wall`. With `-Wall`, the code
snippet warns about the missing signature on `main`, but when I add the
`OPTIONS_GHC`, the warning goes away. Thus this problem appears to be
unique to `Weverything`.
--
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/16075#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list