[project @ 1999-07-26 15:30:29 by simonpj]
authorsimonpj <unknown>
Mon, 26 Jul 1999 15:30:29 +0000 (15:30 +0000)
committersimonpj <unknown>
Mon, 26 Jul 1999 15:30:29 +0000 (15:30 +0000)
Add rnfail017

ghc/tests/rename/should_fail/rnfail016.hs [new file with mode: 0644]
ghc/tests/rename/should_fail/rnfail016.stderr [new file with mode: 0644]
ghc/tests/rename/should_fail/rnfail017.hs [new file with mode: 0644]
ghc/tests/rename/should_fail/rnfail017.stderr [new file with mode: 0644]

diff --git a/ghc/tests/rename/should_fail/rnfail016.hs b/ghc/tests/rename/should_fail/rnfail016.hs
new file mode 100644 (file)
index 0000000..1fa71c5
--- /dev/null
@@ -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 (file)
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 (file)
index 0000000..327a9d6
--- /dev/null
@@ -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 (file)
index 0000000..6ae37a5
--- /dev/null
@@ -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
+