"dodo" bug

Edmund GRIMLEY EVANS Edmund.Grimley-Evans@arm.com
Wed, 1 May 2002 20:34:48 +0100


The following program prints 16843011 when I run it (version December
2001 of Hugs, compiled with gcc-3.0 or gcc-2.95.1).

Replace "else x" by "else True" to get the expected result.

Can you reproduce this, or is my system broken?

Edmund


jj [] = 0
jj (x:xs) = x + (jj xs) * 256

dodo :: Int
dodo = jj (map f [0..3]) where

	f k = y where

		y = case True of
			_ -> (if (if True then True else x) then id else id) 0

		x = True

main = print dodo