New handling of overlapping inst in Safe Haskell
[ghc.git] / testsuite / tests / safeHaskell / overlapping / SH_Overlap11.hs
1 {-# OPTIONS_GHC -fwarn-unsafe #-}
2 {-# LANGUAGE FlexibleInstances #-}
3
4 -- | Same as `SH_Overlap6`, but now we are inferring safety. Should be inferred
5 -- unsafe due to overlapping instances at call site `f`.
6 --
7 -- Testing that we are given correct reason.
8 module SH_Overlap11 where
9
10 import SH_Overlap11_A
11
12 instance
13 C [a] where
14 f _ = "[a]"
15
16 test :: String
17 test = f ([1,2,3,4] :: [Int])
18