From 7e9bd3d5f9279c63d94039a2defa6f0cc5e13345 Mon Sep 17 00:00:00 2001
From: simonpj <unknown>
Date: Mon, 26 Jul 1999 15:30:29 +0000
Subject: [PATCH] [project @ 1999-07-26 15:30:29 by simonpj] Add rnfail017

---
 ghc/tests/rename/should_fail/rnfail016.hs     |  8 ++++++++
 ghc/tests/rename/should_fail/rnfail016.stderr |  0
 ghc/tests/rename/should_fail/rnfail017.hs     | 17 +++++++++++++++++
 ghc/tests/rename/should_fail/rnfail017.stderr | 11 +++++++++++
 4 files changed, 36 insertions(+)
 create mode 100644 ghc/tests/rename/should_fail/rnfail016.hs
 create mode 100644 ghc/tests/rename/should_fail/rnfail016.stderr
 create mode 100644 ghc/tests/rename/should_fail/rnfail017.hs
 create mode 100644 ghc/tests/rename/should_fail/rnfail017.stderr

diff --git a/ghc/tests/rename/should_fail/rnfail016.hs b/ghc/tests/rename/should_fail/rnfail016.hs
new file mode 100644
index 000000000000..1fa71c583a08
--- /dev/null
+++ b/ghc/tests/rename/should_fail/rnfail016.hs
@@ -0,0 +1,8 @@
+module ShouldFail where
+
+-- !!! Pattern syntax in expressions
+
+f x = x @ x
+g x = ~ x
+h x = _
+
diff --git a/ghc/tests/rename/should_fail/rnfail016.stderr b/ghc/tests/rename/should_fail/rnfail016.stderr
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/ghc/tests/rename/should_fail/rnfail017.hs b/ghc/tests/rename/should_fail/rnfail017.hs
new file mode 100644
index 000000000000..327a9d6abdb5
--- /dev/null
+++ b/ghc/tests/rename/should_fail/rnfail017.hs
@@ -0,0 +1,17 @@
+module ShouldFail where
+
+-- !!! Precedence of unary negation
+
+f1 x y = x + -y 	-- Fails
+f2 x y = x * -y		-- Fails
+
+
+f3 x y = -x + y		-- OK: means  (-x) + y
+			-- since - is left associative
+
+f4 x y = - x*y		-- OK: means -(x*y)
+			-- since - binds less tightly than *
+
+f5 x y = x >= -y	-- OK means x >= (-y)
+
+
diff --git a/ghc/tests/rename/should_fail/rnfail017.stderr b/ghc/tests/rename/should_fail/rnfail017.stderr
new file mode 100644
index 000000000000..6ae37a5ed52a
--- /dev/null
+++ b/ghc/tests/rename/should_fail/rnfail017.stderr
@@ -0,0 +1,11 @@
+
+rnfail017.hs:5:
+    precedence parsing error
+	cannot mix `+' (infixl 6) and `negate' (infixl 6) in the same infix expression
+
+rnfail017.hs:6:
+    precedence parsing error
+	cannot mix `*' (infixl 7) and `negate' (infixl 6) in the same infix expression
+
+Compilation had errors
+
-- 
GitLab