Skip to content

Weverything ignores some OPTIONS_GHC flags

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.

Edited by Ben Gamari
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information