Commit 9bb85814 authored by simonpj's avatar simonpj
Browse files

Test pattern-match overlap checking for GADTs

parent 55976aa1
module Gadt where
data T a where
T1 :: T Int
T2 :: T a
T3 :: T Bool
f :: T Int -> Bool
f T1 = True
f T2 = False
g :: T Bool -> Bool
g T2 = True
g T3 = False
h :: T a -> Bool
h T1 = True
h T2 = False
Warning: Pattern match(es) are non-exhaustive
In the definition of `h': Patterns not matched: T3
......@@ -70,3 +70,5 @@ test('ds062', normal, compile, [''])
test('T2409', normal, compile, [''])
test('T3263-1', if_compiler_lt('ghc', '6.11', expect_fail), compile, ['-fwarn-unused-do-bind -XRecursiveDo'])
test('T3263-2', if_compiler_lt('ghc', '6.11', expect_fail), compile, ['-fwarn-wrong-do-bind -XScopedTypeVariables -XRecursiveDo'])
test('GadtOverlap', normal, compile, ['-Wall'])
Supports Markdown
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