Commit e44d60e0 authored by Simon Peyton Jones's avatar Simon Peyton Jones

Test Trac #2395

parent d080e4a1
{-# 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
T2395.hs:12:0:
Warning: Pattern match(es) are overlapped
In the definition of `bar': bar _ = ...
......@@ -73,3 +73,4 @@ test('T3263-1', if_compiler_lt('ghc', '6.11', expect_fail), compile, ['-fwarn-un
test('T3263-2', if_compiler_lt('ghc', '6.11', expect_fail), compile, ['-fwarn-wrong-do-bind -XScopedTypeVariables -XRecursiveDo'])
test('GadtOverlap', normal, compile, ['-Wall'])
test('T2395', normal, compile, [''])
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment