summaryrefslogtreecommitdiff
path: root/testsuite/tests/deSugar/should_compile/T4488.hs
blob: c5bae4e536226ef0ada628aa52f739f118c102ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{-# OPTIONS -fwarn-identities #-}

-- Test warnings about identities

module T4488 where

-- ok1 :: Int -> Float
ok1 x = fromIntegral x

warn1 :: Int -> Int
warn1 x = fromIntegral 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