[commit: ghc] master: Testsuite: add arrows/should_compile/T5333 (#5333) (6880277)

git at git.haskell.org git at git.haskell.org
Thu Jul 30 20:54:31 UTC 2015


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/6880277381061593da2c2c19767ba508fb4045e3/ghc

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

commit 6880277381061593da2c2c19767ba508fb4045e3
Author: Thomas Miedema <thomasmiedema at gmail.com>
Date:   Mon Jul 27 21:46:26 2015 +0200

    Testsuite: add arrows/should_compile/T5333 (#5333)


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

6880277381061593da2c2c19767ba508fb4045e3
 testsuite/tests/arrows/should_compile/T5333.hs | 28 ++++++++++++++++++++++++++
 testsuite/tests/arrows/should_compile/all.T    |  1 +
 2 files changed, 29 insertions(+)

diff --git a/testsuite/tests/arrows/should_compile/T5333.hs b/testsuite/tests/arrows/should_compile/T5333.hs
new file mode 100644
index 0000000..808b8a2
--- /dev/null
+++ b/testsuite/tests/arrows/should_compile/T5333.hs
@@ -0,0 +1,28 @@
+{-# LANGUAGE Arrows, NoMonomorphismRestriction #-}
+module T5333 where
+
+import Prelude hiding ( id, (.) )
+import Control.Arrow
+
+cc1 :: a e b -> a e b -> a e b
+cc1 = undefined
+
+-- With GHC < 7.10.1, the following compile failures occured:
+--
+-- ghc: panic! (the 'impossible' happened)
+--  (GHC version 7.8.4 for x86_64-unknown-linux):
+--  mkCmdEnv Not found: base:GHC.Desugar.>>>{v 02V}
+
+-- 'g' fails to compile.
+g = proc (x, y, z) ->
+   ((returnA -< x) &&& (returnA -< y) &&& (returnA -< z))
+
+-- 'f' compiles:
+--   - without an infix declaration
+--   - with the infixl declaration
+-- and fails with the infixr declaration
+infixr 6 `cc1`
+-- infixl 6 `cc1`
+
+f = proc (x, y, z) ->
+  ((returnA -< x) `cc1` (returnA -< y) `cc1` (returnA -< z))
diff --git a/testsuite/tests/arrows/should_compile/all.T b/testsuite/tests/arrows/should_compile/all.T
index af287cc..ace8af5 100644
--- a/testsuite/tests/arrows/should_compile/all.T
+++ b/testsuite/tests/arrows/should_compile/all.T
@@ -15,3 +15,4 @@ test('T3964', normal, compile, [''])
 test('T5283', normal, compile, [''])
 test('T5267', expect_broken(5267), compile, [''])
 test('T5022', normal, compile, [''])
+test('T5333', normal, compile, [''])



More information about the ghc-commits mailing list