summaryrefslogtreecommitdiff
path: root/testsuite/tests/safeHaskell/overlapping/SH_Overlap11.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/safeHaskell/overlapping/SH_Overlap11.hs')
-rw-r--r--testsuite/tests/safeHaskell/overlapping/SH_Overlap11.hs18
1 files changed, 18 insertions, 0 deletions
diff --git a/testsuite/tests/safeHaskell/overlapping/SH_Overlap11.hs b/testsuite/tests/safeHaskell/overlapping/SH_Overlap11.hs
new file mode 100644
index 0000000000..f591c0a188
--- /dev/null
+++ b/testsuite/tests/safeHaskell/overlapping/SH_Overlap11.hs
@@ -0,0 +1,18 @@
+{-# OPTIONS_GHC -fwarn-unsafe #-}
+{-# LANGUAGE FlexibleInstances #-}
+
+-- | Same as `SH_Overlap6`, but now we are inferring safety. Should be inferred
+-- unsafe due to overlapping instances at call site `f`.
+--
+-- Testing that we are given correct reason.
+module SH_Overlap11 where
+
+import SH_Overlap11_A
+
+instance
+ C [a] where
+ f _ = "[a]"
+
+test :: String
+test = f ([1,2,3,4] :: [Int])
+