summaryrefslogtreecommitdiff
path: root/testsuite/tests/deSugar/should_compile/ds051.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/deSugar/should_compile/ds051.hs')
-rw-r--r--testsuite/tests/deSugar/should_compile/ds051.hs33
1 files changed, 33 insertions, 0 deletions
diff --git a/testsuite/tests/deSugar/should_compile/ds051.hs b/testsuite/tests/deSugar/should_compile/ds051.hs
new file mode 100644
index 0000000000..70c51a792f
--- /dev/null
+++ b/testsuite/tests/deSugar/should_compile/ds051.hs
@@ -0,0 +1,33 @@
+module ShouldCompile where
+
+-- !!! test the overlapping patterns detection.
+
+-- f1 overlaps
+f1 "ab" = []
+f1 "ab" = []
+f1 _ = []
+
+-- f2 overlaps
+f2 "ab" = []
+f2 ('a':'b':[]) = []
+f2 _ = []
+
+-- f3 overlaps
+f3 ('a':'b':[]) = []
+f3 "ab" = []
+f3 _ = []
+
+-- f4 doesn't overlap
+f4 "ab" = []
+f4 ('a':'b':'c':[]) = []
+f4 _ = []
+
+-- f5 doesn't overlap
+f5 ('a':'b':'c':[]) = []
+f5 "ab" = []
+f5 _ = []
+
+-- f6 doesn't overlap
+f6 "ab" = []
+f6 ('a':[]) = []
+f6 _ = []