From 69add38d17e7d296d47b03b87ac4badf40d050a8 Mon Sep 17 00:00:00 2001 From: sof <unknown> Date: Sat, 6 Feb 1999 16:10:25 +0000 Subject: [PATCH] [project @ 1999-02-06 16:10:18 by sof] New regression test - overlapped patterns involving labelled fields. --- ghc/tests/deSugar/should_compile/ds002.stderr | 1 + ghc/tests/deSugar/should_compile/ds003.stderr | 1 + ghc/tests/deSugar/should_compile/ds019.stderr | 1 + ghc/tests/deSugar/should_compile/ds020.stderr | 1 + ghc/tests/deSugar/should_compile/ds022.stderr | 1 + ghc/tests/deSugar/should_compile/ds040.stderr | 1 + ghc/tests/deSugar/should_compile/ds043.hs | 11 +++++++++++ ghc/tests/deSugar/should_compile/ds043.stderr | 6 ++++++ 8 files changed, 23 insertions(+) create mode 100644 ghc/tests/deSugar/should_compile/ds043.hs create mode 100644 ghc/tests/deSugar/should_compile/ds043.stderr diff --git a/ghc/tests/deSugar/should_compile/ds002.stderr b/ghc/tests/deSugar/should_compile/ds002.stderr index beaeb336242b..a5435e88d21c 100644 --- a/ghc/tests/deSugar/should_compile/ds002.stderr +++ b/ghc/tests/deSugar/should_compile/ds002.stderr @@ -1,3 +1,4 @@ + ds002.hs:7: Pattern match(es) are overlapped in the definition of function `f': f y = ... f z = ... diff --git a/ghc/tests/deSugar/should_compile/ds003.stderr b/ghc/tests/deSugar/should_compile/ds003.stderr index 188cae5d4ad9..c7a52de00510 100644 --- a/ghc/tests/deSugar/should_compile/ds003.stderr +++ b/ghc/tests/deSugar/should_compile/ds003.stderr @@ -1,3 +1,4 @@ + ds003.hs:5: Pattern match(es) are overlapped in the definition of function `f': f (x : (x1 : (x2 : x3))) ~(y, ys) z = ... f x y True = ... diff --git a/ghc/tests/deSugar/should_compile/ds019.stderr b/ghc/tests/deSugar/should_compile/ds019.stderr index 874b393d40e8..318885bc0f28 100644 --- a/ghc/tests/deSugar/should_compile/ds019.stderr +++ b/ghc/tests/deSugar/should_compile/ds019.stderr @@ -1,3 +1,4 @@ + ds019.hs:5: Pattern match(es) are overlapped in the definition of function `f': f d (j, k) p = ... f (e, f, g) l q = ... diff --git a/ghc/tests/deSugar/should_compile/ds020.stderr b/ghc/tests/deSugar/should_compile/ds020.stderr index 909af82d9a2f..d75568c9d474 100644 --- a/ghc/tests/deSugar/should_compile/ds020.stderr +++ b/ghc/tests/deSugar/should_compile/ds020.stderr @@ -1,3 +1,4 @@ + ds020.hs:5: Pattern match(es) are overlapped in the definition of function `a': a ~(~[], ~[], ~[]) = ... diff --git a/ghc/tests/deSugar/should_compile/ds022.stderr b/ghc/tests/deSugar/should_compile/ds022.stderr index 380086f9a02a..d935cb46ccd5 100644 --- a/ghc/tests/deSugar/should_compile/ds022.stderr +++ b/ghc/tests/deSugar/should_compile/ds022.stderr @@ -1,3 +1,4 @@ + ds022.hs:20: Pattern match(es) are overlapped in the definition of function `i': i 1 1.1 = ... i 2 2.2 = ... diff --git a/ghc/tests/deSugar/should_compile/ds040.stderr b/ghc/tests/deSugar/should_compile/ds040.stderr index c20c84f9a35b..f420d6a71967 100644 --- a/ghc/tests/deSugar/should_compile/ds040.stderr +++ b/ghc/tests/deSugar/should_compile/ds040.stderr @@ -1,3 +1,4 @@ + ds040.hs:7: Pattern match(es) are overlapped in the definition of function `^^^^': ^^^^ _ _ = ... diff --git a/ghc/tests/deSugar/should_compile/ds043.hs b/ghc/tests/deSugar/should_compile/ds043.hs new file mode 100644 index 000000000000..5c7d746b8ba7 --- /dev/null +++ b/ghc/tests/deSugar/should_compile/ds043.hs @@ -0,0 +1,11 @@ +-- !!! Checking the exhaustiveness of constructor +-- !!! with labelled fields. +module ShouldCompile where + +data E = B { a,b,c,d,e,f :: Bool } + +bug x = + case x of + B _ _ _ _ True False -> undefined + B {e=True, f=False} -> undefined + B {a=a,f=False,e=False} -> undefined diff --git a/ghc/tests/deSugar/should_compile/ds043.stderr b/ghc/tests/deSugar/should_compile/ds043.stderr new file mode 100644 index 000000000000..4ffb3fb090a2 --- /dev/null +++ b/ghc/tests/deSugar/should_compile/ds043.stderr @@ -0,0 +1,6 @@ + +ds043.hs:8: Pattern match(es) are overlapped in a group of case alternatives beginning + (B _ _ _ _ True False): + B {e = True, f = False} -> ... + + -- GitLab