summaryrefslogtreecommitdiff
path: root/testsuite/tests/rename
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2018-09-20 19:53:56 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2018-09-23 02:45:23 +0100
commitcad5d0b69bc039b635a6eb0e5c9ed47d7c5a38ed (patch)
treee245f11c6cb56e4422a9e0875ceacd93c3ef4096 /testsuite/tests/rename
parent7e77f41430ae1cad84d5b0c90328331d38f3eda0 (diff)
downloadhaskell-cad5d0b69bc039b635a6eb0e5c9ed47d7c5a38ed.tar.gz
Buglet in reporting out of scope errors in rules
Most out of scope errors get reported by the type checker these days, but not all. Example, the function on the LHS of a RULE. Trace #15659 pointed out that this less-heavily-used code path produce a "wacky" error message. Indeed so. Easily fixed.
Diffstat (limited to 'testsuite/tests/rename')
-rw-r--r--testsuite/tests/rename/should_fail/T15659.hs5
-rw-r--r--testsuite/tests/rename/should_fail/T15659.stderr6
-rw-r--r--testsuite/tests/rename/should_fail/all.T2
3 files changed, 12 insertions, 1 deletions
diff --git a/testsuite/tests/rename/should_fail/T15659.hs b/testsuite/tests/rename/should_fail/T15659.hs
new file mode 100644
index 0000000000..9fa516f2b6
--- /dev/null
+++ b/testsuite/tests/rename/should_fail/T15659.hs
@@ -0,0 +1,5 @@
+module T15659 where
+
+{-# RULES "test" forall x. f x = x #-}
+
+
diff --git a/testsuite/tests/rename/should_fail/T15659.stderr b/testsuite/tests/rename/should_fail/T15659.stderr
new file mode 100644
index 0000000000..e1cbf9f079
--- /dev/null
+++ b/testsuite/tests/rename/should_fail/T15659.stderr
@@ -0,0 +1,6 @@
+
+T15659.hs:3:11: error:
+ Rule "test":
+ Not in scope: ‘f’
+ in left-hand side: f x
+ LHS must be of form (f e1 .. en) where f is not forall'd
diff --git a/testsuite/tests/rename/should_fail/all.T b/testsuite/tests/rename/should_fail/all.T
index c69efb9c66..f8b950b563 100644
--- a/testsuite/tests/rename/should_fail/all.T
+++ b/testsuite/tests/rename/should_fail/all.T
@@ -134,4 +134,4 @@ test('T14591', normal, compile_fail, [''])
test('T15214', normal, compile_fail, [''])
test('T15539', normal, compile_fail, [''])
test('T15487', normal, multimod_compile_fail, ['T15487','-v0'])
-
+test('T15659', normal, compile_fail, [''])