diff --git a/ghc/tests/rename/should_fail/rnfail016.hs b/ghc/tests/rename/should_fail/rnfail016.hs new file mode 100644 index 0000000000000000000000000000000000000000..1fa71c583a083a1a8a364e29198fe6ac922cab7f --- /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 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/ghc/tests/rename/should_fail/rnfail017.hs b/ghc/tests/rename/should_fail/rnfail017.hs new file mode 100644 index 0000000000000000000000000000000000000000..327a9d6abdb5b6c8ae2cc90f6c0f978bc9f36d18 --- /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 0000000000000000000000000000000000000000..6ae37a5ed52a2b226c251f2ca785d536da8b59cb --- /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 +