summaryrefslogtreecommitdiff
path: root/testsuite/tests/rename/should_fail/T5211.hs
blob: 56c958cd1e2c7641a73381365b952b6cbf8509ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{-# OPTIONS_GHC -fwarn-unused-imports  #-}
module RedundantImport where

-- this import is redundant, but GHC does not spot it
import qualified Foreign.Storable

import Foreign.Storable (Storable, sizeOf, alignment, peek, poke, )
import Foreign.Ptr (castPtr, )

newtype T a = Cons a

instance Storable a => Storable (T a) where
   sizeOf (Cons a) = sizeOf a
   alignment (Cons a) = alignment a
   peek = fmap Cons . peek . castPtr
   poke p (Cons a) = poke (castPtr p) a