#6012: No warning for Incorrect display of 15! (factorial 15) when type is Int
->
Int
-----------------------------------------+----------------------------------
Reporter: George.Atelier | Owner:
Type: bug | Status: new
Priority: normal | Component: Compiler
Version: 7.0.4 | Keywords: Int Integer
recursion
Os: Windows | Architecture: x86_64 (amd64)
Failure: Incorrect result at runtime | Testcase: factorial 15
Blockedby: | Blocking:
Related: |
-----------------------------------------+----------------------------------
GHCi version: 7.0.4
Offending function:
factorial :: Int -> Int
factorial 0 = 1
factorial n = n * factorial (n-1)
Correct answer is displayed (as expected) when type is
factorial :: Integer -> Integer
THE BUG IS THE DISPLAY OF A CORRECT-LOOKING INCORRECT ANSWER THAT RESULTED
FROM (UNREPORTED) OVERFLOW OF Int (but not of Integer)
~~ Thank you
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/6012>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs