[commit: ghc] ghc-8.0: testsuite: Add test for #11959 (07a3404)

git at git.haskell.org git at git.haskell.org
Mon Sep 5 21:27:10 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-8.0
Link       : http://ghc.haskell.org/trac/ghc/changeset/07a3404a9ccf7004abc0c02efd114c2a1f7cbf77/ghc

>---------------------------------------------------------------

commit 07a3404a9ccf7004abc0c02efd114c2a1f7cbf77
Author: Ben Gamari <bgamari.foss at gmail.com>
Date:   Tue May 3 22:58:47 2016 +0200

    testsuite: Add test for #11959
    
    Test Plan: Validate, expected to fail
    
    Reviewers: goldfire, austin
    
    Reviewed By: austin
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D2132
    
    GHC Trac Issues: #11959
    
    (cherry picked from commit 4f2afe1e674606230f2dc2f8ce040a2bd345a647)


>---------------------------------------------------------------

07a3404a9ccf7004abc0c02efd114c2a1f7cbf77
 testsuite/tests/patsyn/should_compile/T11959.hs     |  6 ++++++
 testsuite/tests/patsyn/should_compile/T11959.stdout |  3 +++
 testsuite/tests/patsyn/should_compile/T11959Lib.hs  | 11 +++++++++++
 testsuite/tests/patsyn/should_compile/all.T         |  1 +
 4 files changed, 21 insertions(+)

diff --git a/testsuite/tests/patsyn/should_compile/T11959.hs b/testsuite/tests/patsyn/should_compile/T11959.hs
new file mode 100644
index 0000000..ccff2e0
--- /dev/null
+++ b/testsuite/tests/patsyn/should_compile/T11959.hs
@@ -0,0 +1,6 @@
+{-# LANGUAGE PatternSynonyms #-}
+module Main where
+
+import T11959Lib (Vec2(..), pattern (:>))
+
+main = return ()
diff --git a/testsuite/tests/patsyn/should_compile/T11959.stdout b/testsuite/tests/patsyn/should_compile/T11959.stdout
new file mode 100644
index 0000000..01c0f01
--- /dev/null
+++ b/testsuite/tests/patsyn/should_compile/T11959.stdout
@@ -0,0 +1,3 @@
+
+T11959Lib.hs:2:35: warning: [-Wduplicate-exports (in -Wdefault)]
+    ‘:>’ is exported by ‘(:>)’ and ‘Vec2(Nil, type (:>))’
diff --git a/testsuite/tests/patsyn/should_compile/T11959Lib.hs b/testsuite/tests/patsyn/should_compile/T11959Lib.hs
new file mode 100644
index 0000000..4c00721
--- /dev/null
+++ b/testsuite/tests/patsyn/should_compile/T11959Lib.hs
@@ -0,0 +1,11 @@
+{-# LANGUAGE PatternSynonyms, ViewPatterns #-}
+module T11959Lib (Vec2(Nil,(:>)), pattern (:>)) where
+
+newtype Vec2 a = Vec2 {unvec2 :: [a]}
+
+pattern Nil :: Vec2 a
+pattern Nil = Vec2 []
+
+pattern (:>) x xs <- ((\ys -> (head $ unvec2 ys,Vec2 . tail $ unvec2 ys)) -> (x,xs))
+  where
+    (:>) x xs = Vec2 (x:unvec2 xs)
diff --git a/testsuite/tests/patsyn/should_compile/all.T b/testsuite/tests/patsyn/should_compile/all.T
index 00d3b87..9bb4f59 100644
--- a/testsuite/tests/patsyn/should_compile/all.T
+++ b/testsuite/tests/patsyn/should_compile/all.T
@@ -54,3 +54,4 @@ test('T11633', normal, compile, [''])
 test('T12094', normal, compile, [''])
 test('T12484', normal, compile, [''])
 test('T12489', normal, compile, [''])
+test('T11959', expect_broken(11959), multimod_compile, ['T11959', '-v0'])



More information about the ghc-commits mailing list