bug (?) in type checking of record update

Johannes Waldmann <[email protected]>
Newsgroups gmane.comp.lang.haskell.hugs.bugs
Message-ID <Pine.GSO.4.21.0302041050300.28679-100000@isun11.informatik.uni-leipzig.de>
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/ --
-- [email protected] -- phone/fax (+49) 341 9732 204/207 --
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.