summaryrefslogtreecommitdiff
path: root/testsuite/tests
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2020-02-07 15:26:44 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-02-28 22:03:23 -0500
commit66f5d6d634698ce054a9b9ce0c53ce9682f6f042 (patch)
tree24225b89347cb0f32cff1f3921d71305f5fbdaab /testsuite/tests
parentf97d1fb614ff7638d13eb7c552d2a72fce4c613a (diff)
downloadhaskell-66f5d6d634698ce054a9b9ce0c53ce9682f6f042.tar.gz
Improve error handling for VTA + deferred type errors
This fixes #17792 See Note [VTA for out-of-scope functions] in TcExpr
Diffstat (limited to 'testsuite/tests')
-rw-r--r--testsuite/tests/typecheck/should_compile/T17792.hs10
-rw-r--r--testsuite/tests/typecheck/should_compile/T17792.stderr3
-rw-r--r--testsuite/tests/typecheck/should_compile/all.T1
-rw-r--r--testsuite/tests/typecheck/should_fail/T13834.stderr3
4 files changed, 16 insertions, 1 deletions
diff --git a/testsuite/tests/typecheck/should_compile/T17792.hs b/testsuite/tests/typecheck/should_compile/T17792.hs
new file mode 100644
index 0000000000..3b18f566c4
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T17792.hs
@@ -0,0 +1,10 @@
+{-# LANGUAGE TypeApplications #-}
+{-# OPTIONS_GHC -fdefer-type-errors #-}
+
+module T17792 where
+
+class C a where
+ m :: a
+
+instance C Bool where
+ m = notInScope @Word
diff --git a/testsuite/tests/typecheck/should_compile/T17792.stderr b/testsuite/tests/typecheck/should_compile/T17792.stderr
new file mode 100644
index 0000000000..2c499f91b9
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T17792.stderr
@@ -0,0 +1,3 @@
+
+T17792.hs:10:7: warning: [-Wdeferred-out-of-scope-variables (in -Wdefault)]
+ Variable not in scope: notInScope :: Bool
diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T
index d143251f9b..c1cd076a6d 100644
--- a/testsuite/tests/typecheck/should_compile/all.T
+++ b/testsuite/tests/typecheck/should_compile/all.T
@@ -697,3 +697,4 @@ test('T17566', [extra_files(['T17566a.hs'])], makefile_test, [])
test('T12760', unless(compiler_debugged(), skip), compile, ['-O'])
test('T13142', normal, compile, ['-O2'])
test('T12926', reqlib('vector'), compile, ['-O2'])
+test('T17792', normal, compile, [''])
diff --git a/testsuite/tests/typecheck/should_fail/T13834.stderr b/testsuite/tests/typecheck/should_fail/T13834.stderr
index 73d739ea87..864b5ab7ae 100644
--- a/testsuite/tests/typecheck/should_fail/T13834.stderr
+++ b/testsuite/tests/typecheck/should_fail/T13834.stderr
@@ -1,2 +1,3 @@
-T13834.hs:5:7: error: Variable not in scope: notInScope
+T13834.hs:5:7:
+ Variable not in scope: notInScope :: Bool -> t