Commit f53b2d98 authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Test Trac #4488

parent 850e09ef
{-# OPTIONS -fwarn-identities #-}
-- Test warnings about identities
module T4488 where
-- ok1 :: Int -> Float
ok1 x = fromIntegral x
warn1 :: Int -> Int
warn1 x = fromIntegral x
ok2 :: Integer -> Float
ok2 x = fromInteger x
warn2 :: Integer -> Integer
warn2 x = fromInteger x
-- ok3 :: Rational -> Float
ok3 x = fromRational x
warn3 :: Rational -> Rational
warn3 x = fromRational x
ok4 :: Int -> Integer
ok4 x = toInteger x
warn4 :: Integer -> Integer
warn4 x = toInteger x
ok5 :: Float -> Rational
ok5 x = toRational x
warn5 :: Rational -> Rational
warn5 x = toRational x
-- ok6 :: Float -> Rational
ok6 x = realToFrac x
warn6 :: Float -> Float
warn6 x = realToFrac x
T4488.hs:11:11:
Warning: Call of fromIntegral :: Int -> Int
can probably be omitted
(Use -fno-warn-identities to suppress this messsage))
T4488.hs:17:11:
Warning: Call of fromInteger :: Integer -> Integer
can probably be omitted
(Use -fno-warn-identities to suppress this messsage))
T4488.hs:23:11:
Warning: Call of fromRational :: Rational -> Rational
can probably be omitted
(Use -fno-warn-identities to suppress this messsage))
T4488.hs:29:11:
Warning: Call of toInteger :: Integer -> Integer
can probably be omitted
(Use -fno-warn-identities to suppress this messsage))
T4488.hs:35:11:
Warning: Call of toRational :: Rational -> Rational
can probably be omitted
(Use -fno-warn-identities to suppress this messsage))
T4488.hs:41:11:
Warning: Call of realToFrac :: Float -> Float
can probably be omitted
(Use -fno-warn-identities to suppress this messsage))
......@@ -76,3 +76,4 @@ test('GadtOverlap', normal, compile, ['-Wall'])
test('T2395', normal, compile, [''])
test('T4371', normal, compile, [''])
test('T4439', normal, compile, [''])
test('T4488', normal, compile, [''])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment