summaryrefslogtreecommitdiff
path: root/testsuite/tests
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2016-10-13 12:24:53 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2016-10-13 12:32:00 +0100
commit2fdf21bf26386ac5558ed5b95105bcf78e31f093 (patch)
tree60dc13508df7aa1a96f1e7c13cdc09e9c412989b /testsuite/tests
parent57f7a37d90d77df1de804cd9ddd3d87da094faf4 (diff)
downloadhaskell-2fdf21bf26386ac5558ed5b95105bcf78e31f093.tar.gz
Further improve error handling in TcRn monad
This patch builds on the one for Trac #12124, by dealing properly with out-of-scope "hole" errors. This fixes Trac #12529. The hard error coming from visible type application is still there, but the out-of-scope error is no longer suppressed. (Arguably the VTA message should be suppressed somehow, but that's a battle for another day.)
Diffstat (limited to 'testsuite/tests')
-rw-r--r--testsuite/tests/typecheck/should_fail/T12529.hs5
-rw-r--r--testsuite/tests/typecheck/should_fail/T12529.stderr8
-rw-r--r--testsuite/tests/typecheck/should_fail/all.T2
3 files changed, 15 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_fail/T12529.hs b/testsuite/tests/typecheck/should_fail/T12529.hs
new file mode 100644
index 0000000000..ac4e31db68
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T12529.hs
@@ -0,0 +1,5 @@
+{-# LANGUAGE TypeApplications #-}
+
+module T12529 where
+
+f = p @ Int
diff --git a/testsuite/tests/typecheck/should_fail/T12529.stderr b/testsuite/tests/typecheck/should_fail/T12529.stderr
new file mode 100644
index 0000000000..cd9897e89f
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T12529.stderr
@@ -0,0 +1,8 @@
+
+T12529.hs:5:5: error: Variable not in scope: p
+
+T12529.hs:5:5: error:
+ • Cannot apply expression of type ‘t1’
+ to a visible type argument ‘Int’
+ • In the expression: p @Int
+ In an equation for ‘f’: f = p @Int
diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T
index 4c16c0d439..78da1c7639 100644
--- a/testsuite/tests/typecheck/should_fail/all.T
+++ b/testsuite/tests/typecheck/should_fail/all.T
@@ -428,3 +428,5 @@ test('T12406', normal, compile_fail, [''])
test('T12170a', normal, compile_fail, [''])
test('T12124', normal, compile_fail, [''])
test('T12589', normal, compile_fail, [''])
+test('T12529', normal, compile_fail, [''])
+