New handling of overlapping inst in Safe Haskell
[ghc.git] / testsuite / tests / safeHaskell / overlapping / SH_Overlap10.hs
1 {-# OPTIONS_GHC -fwarn-unsafe #-}
2 {-# LANGUAGE FlexibleInstances #-}
3
4 -- | Same as `SH_Overlap6`, but now we are inferring safety. Safe since
5 -- overlapped instance declares itself overlappable.
6 module SH_Overlap10 where
7
8 import SH_Overlap10_A
9
10 instance
11 {-# OVERLAPS #-}
12 C [a] where
13 f _ = "[a]"
14
15 test :: String
16 test = f ([1,2,3,4] :: [Int])
17