summaryrefslogtreecommitdiff
path: root/testsuite/tests/deSugar/should_compile/T2395.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/deSugar/should_compile/T2395.hs')
-rw-r--r--testsuite/tests/deSugar/should_compile/T2395.hs13
1 files changed, 13 insertions, 0 deletions
diff --git a/testsuite/tests/deSugar/should_compile/T2395.hs b/testsuite/tests/deSugar/should_compile/T2395.hs
new file mode 100644
index 0000000000..8600690279
--- /dev/null
+++ b/testsuite/tests/deSugar/should_compile/T2395.hs
@@ -0,0 +1,13 @@
+{-# LANGUAGE ViewPatterns #-}
+{-# OPTIONS_GHC -Wall #-}
+
+-- Pattern-match overlap warnings with view patterns
+module T2395 where
+
+foo :: Int -> Int
+foo (even -> True) = 4
+foo _ = 5
+
+bar :: (a, (Int,Int)) -> Int
+bar (snd -> (x,y)) = x+y -- Cannot fail, hence overlap warning should
+bar _ = 6 -- for second pattern