Adding "-fhpc" changes behavior with NegativeLiterals
Summary
-Woverflowed-literals
is thrown when -fhpc
is specified, but not when it's not.
Steps to reproduce
module Foo where
import Data.Int
x :: Int8
x = (-128)
# compiles
ghc Foo.hs -Werror -Wall
# does not compile
ghc Foo.hs -Werror -Wall -fhpc
Expected behavior
Always warn that NegativeLiterals
should be enabled
Environment
- GHC version used: I was able to get this repro'd on GHC 8.6 and 9.2.
Optional:
- Operating System: MacOS + Ubuntu
- System Architecture: X86