Test Trac #5117
authorSimon Peyton Jones <simonpj@microsoft.com>
Wed, 4 May 2011 10:50:24 +0000 (11:50 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Wed, 4 May 2011 10:50:24 +0000 (11:50 +0100)
testsuite/tests/ghc-regress/deSugar/should_compile/T5117.hs [new file with mode: 0644]
testsuite/tests/ghc-regress/deSugar/should_compile/T5117.stderr [new file with mode: 0644]
testsuite/tests/ghc-regress/deSugar/should_compile/all.T

diff --git a/testsuite/tests/ghc-regress/deSugar/should_compile/T5117.hs b/testsuite/tests/ghc-regress/deSugar/should_compile/T5117.hs
new file mode 100644 (file)
index 0000000..15f9c79
--- /dev/null
@@ -0,0 +1,17 @@
+{-# LANGUAGE OverloadedStrings #-}\r
+module BadWarning where\r
+\r
+data MyString = MyString String\r
+\r
+f1 (MyString "a") = undefined\r
+f1 (MyString "bb") = undefined\r
+f1 _ = undefined\r
+\r
+f2 (MyString "aa") = undefined\r
+f2 (MyString "bb") = undefined\r
+f2 _ = undefined\r
+\r
+-- Genuine overlap here!\r
+f3(MyString ('a':_)) = undefined\r
+f3 (MyString "a") = undefined\r
+f3 _ = undefined\r
diff --git a/testsuite/tests/ghc-regress/deSugar/should_compile/T5117.stderr b/testsuite/tests/ghc-regress/deSugar/should_compile/T5117.stderr
new file mode 100644 (file)
index 0000000..e9ddba1
--- /dev/null
@@ -0,0 +1,4 @@
+\r
+T5117.hs:15:1:\r
+    Warning: Pattern match(es) are overlapped\r
+             In an equation for `f3': f3 (MyString "a") = ...\r
index 2441709..6b85275 100644 (file)
@@ -83,3 +83,4 @@ test('T4870',
       extra_clean(['T4870a.hi', 'T4870a.o'])],
      multimod_compile,
      ['T4870', '-v0'])
+test('T5117', normal, compile, [''])