bug (?) in type checking of record update
Johannes Waldmann
joe@isun.informatik.uni-leipzig.de
Tue, 4 Feb 2003 11:00:16 +0100 (MET)
wanna see a large Int in hugs? I mean Int, not Integer.
the program below gives this nice result:
Main> contents bug
1000000000000000000000000000000 :: Int
data Container a =
Container { contents :: a
, info :: String
}
bug :: Container Int
bug = let xs = 10^30
a = Container { contents = xs , info = "foo" }
in a { info = "bar" }
it does so even if i write xs = 10^30 :: Integer
I checked with hugs-november-2002.
With ghc-5.04.2, without the type sig,
ghci converts the numeric expression to an Int (silently overflowing);
and with the type sig, it rejects the program.
best regards,
--
-- Johannes Waldmann ---- http://www.informatik.uni-leipzig.de/~joe/ --
-- joe@informatik.uni-leipzig.de -- phone/fax (+49) 341 9732 204/207 --