Skip to content

fromInteger :: Integer -> Int should fail on overflow

fromInteger 4000000000 :: Int gives -294967296

This is bad; it should really raise an exception.

I believe this is the case with all versions of GHC
Trac metadata
Trac field Value
Version None
Type Bug
TypeOfFailure OtherFailure
Priority lowest
Resolution ResolvedRejected
Component Prelude
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information