diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2019-09-04 08:17:20 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-09-17 19:23:37 -0400 |
commit | 1c3af277582be677a11b1f292acb8c88ca3368b1 (patch) | |
tree | 3e370d1c9ca6cf2d4fb76c5754fe5587c959a29f /testsuite/tests | |
parent | 8039b12546c80610e3a88c9fe59a0efe9c994515 (diff) | |
download | haskell-1c3af277582be677a11b1f292acb8c88ca3368b1.tar.gz |
Improve error message for out-of-scope variables + VTA
As #13834 and #17150 report, we get a TERRIBLE error message when you
have an out of scope variable applied in a visible type application:
(outOfScope @Int True)
This very simple patch improves matters.
See TcExpr Note [VTA for out-of-scope functions]
Diffstat (limited to 'testsuite/tests')
-rw-r--r-- | testsuite/tests/ghci/scripts/T13466.stderr | 5 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T12529.stderr | 6 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T13834.hs | 6 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T13834.stderr | 2 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/all.T | 1 |
5 files changed, 9 insertions, 11 deletions
diff --git a/testsuite/tests/ghci/scripts/T13466.stderr b/testsuite/tests/ghci/scripts/T13466.stderr index edd05c5a4d..a31acf385b 100644 --- a/testsuite/tests/ghci/scripts/T13466.stderr +++ b/testsuite/tests/ghci/scripts/T13466.stderr @@ -1,7 +1,2 @@ <interactive>:1:1: error: Variable not in scope: out_of_scope - -<interactive>:1:1: error: - • Cannot apply expression of type ‘t1’ - to a visible type argument ‘[]’ - • In the expression: out_of_scope @[] diff --git a/testsuite/tests/typecheck/should_fail/T12529.stderr b/testsuite/tests/typecheck/should_fail/T12529.stderr index cd9897e89f..6819cd8dd2 100644 --- a/testsuite/tests/typecheck/should_fail/T12529.stderr +++ b/testsuite/tests/typecheck/should_fail/T12529.stderr @@ -1,8 +1,2 @@ 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/T13834.hs b/testsuite/tests/typecheck/should_fail/T13834.hs new file mode 100644 index 0000000000..005ea79d68 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T13834.hs @@ -0,0 +1,6 @@ +{-# LANGUAGE TypeApplications #-} + +module Bug where + +foo = notInScope @Bool True + diff --git a/testsuite/tests/typecheck/should_fail/T13834.stderr b/testsuite/tests/typecheck/should_fail/T13834.stderr new file mode 100644 index 0000000000..73d739ea87 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T13834.stderr @@ -0,0 +1,2 @@ + +T13834.hs:5:7: error: Variable not in scope: notInScope diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index fc49dbbb68..a239085b86 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -541,3 +541,4 @@ test('UnliftedNewtypesConstraintFamily', normal, compile_fail, ['']) test('UnliftedNewtypesMismatchedKind', normal, compile_fail, ['']) test('UnliftedNewtypesMismatchedKindRecord', normal, compile_fail, ['']) test('UnliftedNewtypesMultiFieldGadt', normal, compile_fail, ['']) +test('T13834', normal, compile_fail, ['']) |