diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2017-08-23 13:55:33 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2017-08-24 14:39:29 +0100 |
commit | a211dca8236fb8c7ec632278f761121beeac1438 (patch) | |
tree | 7a86f779f7f0ea553ae428819690f3738b1d1822 /testsuite | |
parent | 11657c4bdda391d4f21289e3412589a3c520ca2a (diff) | |
download | haskell-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.hs | 8 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_compile/T14149.stderr | 3 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_compile/all.T | 1 |
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, ['']) |