diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2018-08-20 15:54:14 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2018-08-20 15:54:14 +0100 |
commit | ecc0ddf65b1e2700f83f643fffdd41e966013332 (patch) | |
tree | fba58889e4f8d908858e8ac2cbc0c82fd870cad9 /testsuite/tests/rename | |
parent | a08b285f74cd49196feb0f819d70ad0508689da3 (diff) | |
download | haskell-ecc0ddf65b1e2700f83f643fffdd41e966013332.tar.gz |
Initialise cec_suppress properly
In TcErrors, cec_suppress is used to suppress low-priority
errors in favour of truly insoluble ones.
But I was failing to initialise it correcly at top level, which
resulted in Trac #15539. Easy to fix.
A few regression tests have fewer errors reported, but that seems to
be an improvement.
Diffstat (limited to 'testsuite/tests/rename')
-rw-r--r-- | testsuite/tests/rename/should_fail/T15539.hs | 17 | ||||
-rw-r--r-- | testsuite/tests/rename/should_fail/T15539.stderr | 4 | ||||
-rw-r--r-- | testsuite/tests/rename/should_fail/all.T | 1 |
3 files changed, 22 insertions, 0 deletions
diff --git a/testsuite/tests/rename/should_fail/T15539.hs b/testsuite/tests/rename/should_fail/T15539.hs new file mode 100644 index 0000000000..d1b5a37e7b --- /dev/null +++ b/testsuite/tests/rename/should_fail/T15539.hs @@ -0,0 +1,17 @@ +{-# LANGUAGE RankNTypes #-} +module T15539 where + +foo :: String +foo = show a + where a = baz + +-- We get top level constraints +-- Show a +-- forall . <not in scope baz> +-- We want the insoluble non-in-scope error to suppress +-- the Show a, just as it does if the whole things is nested + +bar :: Int +bar = 1 + +bam = putStrLn foo diff --git a/testsuite/tests/rename/should_fail/T15539.stderr b/testsuite/tests/rename/should_fail/T15539.stderr new file mode 100644 index 0000000000..c3de7780d4 --- /dev/null +++ b/testsuite/tests/rename/should_fail/T15539.stderr @@ -0,0 +1,4 @@ + +T15539.hs:6:13: error: + • Variable not in scope: baz + • Perhaps you meant one of these: ‘bar’ (line 15), ‘bam’ (line 17) diff --git a/testsuite/tests/rename/should_fail/all.T b/testsuite/tests/rename/should_fail/all.T index f2bf30ea3f..2eef29f1cc 100644 --- a/testsuite/tests/rename/should_fail/all.T +++ b/testsuite/tests/rename/should_fail/all.T @@ -132,3 +132,4 @@ test('T13847', normal, multimod_compile_fail, ['T13847','-v0']) test('T14307', normal, compile_fail, ['']) test('T14591', normal, compile_fail, ['']) test('T15214', normal, compile_fail, ['']) +test('T15539', normal, compile_fail, ['']) |