From: simonpj Date: Mon, 26 Jul 1999 15:30:29 +0000 (+0000) Subject: [project @ 1999-07-26 15:30:29 by simonpj] X-Git-Tag: Approximately_9120_patches~5961 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=7e9bd3d5f9279c63d94039a2defa6f0cc5e13345;p=ghc-hetmet.git [project @ 1999-07-26 15:30:29 by simonpj] Add rnfail017 --- 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 +