summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2017-08-23 13:55:33 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2017-08-24 14:39:29 +0100
commita211dca8236fb8c7ec632278f761121beeac1438 (patch)
tree7a86f779f7f0ea553ae428819690f3738b1d1822 /testsuite
parent11657c4bdda391d4f21289e3412589a3c520ca2a (diff)
downloadhaskell-a211dca8236fb8c7ec632278f761121beeac1438.tar.gz
Fix defer-out-of-scope-variables
In the hacky code in TcUnify.buildImplication we'd failed to account for -fdefer-out-of-scope-variables. See the new function TcUnify.implicationNeeded. Fixes Trac #14149
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/typecheck/should_compile/T14149.hs8
-rw-r--r--testsuite/tests/typecheck/should_compile/T14149.stderr3
-rw-r--r--testsuite/tests/typecheck/should_compile/all.T1
3 files changed, 12 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_compile/T14149.hs b/testsuite/tests/typecheck/should_compile/T14149.hs
new file mode 100644
index 0000000000..c23d415342
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T14149.hs
@@ -0,0 +1,8 @@
+{-# OPTIONS_GHC -fdefer-out-of-scope-variables #-}
+
+module Foo where
+
+import Data.Coerce
+
+f :: Bool
+f = coerce (k :: Int)
diff --git a/testsuite/tests/typecheck/should_compile/T14149.stderr b/testsuite/tests/typecheck/should_compile/T14149.stderr
new file mode 100644
index 0000000000..5e5306e1b9
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T14149.stderr
@@ -0,0 +1,3 @@
+
+T14149.hs:8:13: warning: [-Wdeferred-out-of-scope-variables (in -Wdefault)]
+ Variable not in scope: k :: Int
diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T
index f522b74329..13a2719c96 100644
--- a/testsuite/tests/typecheck/should_compile/all.T
+++ b/testsuite/tests/typecheck/should_compile/all.T
@@ -571,3 +571,4 @@ test('T13881', normal, compile, [''])
test('T13915a', normal, multimod_compile, ['T13915a', '-v0'])
test('T13915b', normal, compile, [''])
test('T13984', normal, compile, [''])
+test('T14149', normal, compile, [''])