From 7e9bd3d5f9279c63d94039a2defa6f0cc5e13345 Mon Sep 17 00:00:00 2001 From: simonpj Date: Mon, 26 Jul 1999 15:30:29 +0000 Subject: [PATCH 1/1] [project @ 1999-07-26 15:30:29 by simonpj] Add rnfail017 --- ghc/tests/rename/should_fail/rnfail016.hs | 8 ++++++++ ghc/tests/rename/should_fail/rnfail017.hs | 17 +++++++++++++++++ ghc/tests/rename/should_fail/rnfail017.stderr | 11 +++++++++++ 3 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 0000000..1fa71c5 --- /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 0000000..e69de29 diff --git a/ghc/tests/rename/should_fail/rnfail017.hs b/ghc/tests/rename/should_fail/rnfail017.hs new file mode 100644 index 0000000..327a9d6 --- /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 0000000..6ae37a5 --- /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 + -- 1.7.10.4