[GHC] #9854: Literal overflow check is too aggressive

GHC ghc-devs at haskell.org
Tue Dec 2 15:48:24 UTC 2014


#9854: Literal overflow check is too aggressive
-------------------------------------+-------------------------------------
       Reporter:  tibbe              |                   Owner:
           Type:  bug                |                  Status:  new
       Priority:  normal             |               Milestone:
      Component:  Compiler           |                 Version:  7.8.3
       Keywords:                     |        Operating System:
   Architecture:  Unknown/Multiple   |  Unknown/Multiple
     Difficulty:  Unknown            |         Type of failure:
     Blocked By:                     |  None/Unknown
Related Tickets:                     |               Test Case:
                                     |                Blocking:
                                     |  Differential Revisions:
-------------------------------------+-------------------------------------
 The literal overflow check is too aggressive. Sometimes you want to give a
 literal as a hexadecimal value that does fit inside e.g. an `Int`, like
 so:

 {{{
 Prelude> 0xdc36d1615b7400a4 :: Int

 <interactive>:2:1: Warning:
     Literal 15868100553162883236 is out of the Int range
 -9223372036854775808..9223372036854775807
 -2578643520546668380
 }}}

 However the compiler complains because of the wrap-around. I feel this is
 common enough and practice (and perfectly well-defined) that the compiler
 shouldn't warn.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9854>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list