Opened 15 years ago

Closed 14 years ago

Last modified 46 years ago

#516 closed bug (Rejected)

fromInteger :: Integer -> Int should fail on overflow

Reported by: simonpj Owned by: nobody
Priority: lowest Milestone:
Component: Prelude Version: None
Keywords: Cc:
Operating System: Architecture:
Type of failure: Test Case:
Blocked By: Blocking:
Related Tickets: Differential Revisions:

Description

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

Change History (1)

comment:1 Changed 14 years ago by simonmar

  • Status changed from assigned to closed
Logged In: YES 
user_id=48280

fromInteger where the destination type is Int has well 
defined behaviour on overflow, this is now documented in 
the User's Guide.
Note: See TracTickets for help on using tickets.