summaryrefslogtreecommitdiff
path: root/testsuite/tests/deSugar/should_compile/T2395.hs
blob: 8600690279a52b266fd41204dbdb69e9201f279e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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