Testsuite: add arrows/should_compile/T5333 (#5333)
authorThomas Miedema <thomasmiedema@gmail.com>
Mon, 27 Jul 2015 19:46:26 +0000 (21:46 +0200)
committerThomas Miedema <thomasmiedema@gmail.com>
Thu, 30 Jul 2015 20:52:52 +0000 (22:52 +0200)
testsuite/tests/arrows/should_compile/T5333.hs [new file with mode: 0644]
testsuite/tests/arrows/should_compile/all.T

diff --git a/testsuite/tests/arrows/should_compile/T5333.hs b/testsuite/tests/arrows/should_compile/T5333.hs
new file mode 100644 (file)
index 0000000..808b8a2
--- /dev/null
@@ -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))
index af287cc..ace8af5 100644 (file)
@@ -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, [''])