Rule "fromIntegral/Int->Natural" is inconsistent
import GHC.Natural i :: Int i = -10 main :: IO () main = let n :: Natural n = fromIntegral i in print n
- with -O2: prints 18446744073709551606
- with -O0: throw "arithmetic underflow"
While it should always throw an exception (I guess? "fromIntegral" isn't precisely defined in the report).
GHC versions: 9.0, 9.2, HEAD