Skip to content

Undocumented feature of WARNING pragmas

I discovered by reading the parser that the following syntax is accepted for multiple warnings within a single WARNING or DEPRECATED pragma:

{-# WARNING foo "foo is dangerous" ;
            bar "bar is mostly harmless" #-}
foo, bar :: ()
foo = foo
bar = ()

This seems a bit strange, as one could simply write multiple separate WARNING pragmas. It doesn't appear to be documented in the user's guide (https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/pragmas.html#warning-and-deprecated-pragmas). We should document this, or could we remove the feature entirely?

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