diff options
author | Ryan Scott <ryan.gl.scott@gmail.com> | 2019-12-19 11:50:10 -0500 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-12-20 10:50:57 -0500 |
commit | 70e56b272492b65e41a149ec39a939e794fea66b (patch) | |
tree | a030c730bed2d539433ebdf16609aa88439c83fe /testsuite/tests/rename/should_fail | |
parent | 1a0d1a6583cc39a31d6947eda1d4998c4fb53c4f (diff) | |
download | haskell-70e56b272492b65e41a149ec39a939e794fea66b.tar.gz |
lookupBindGroupOcc: recommend names in the same namespace (#17593)
Previously, `lookupBindGroupOcc`'s error message would recommend all
similar names in scope, regardless of whether they were type
constructors, data constructors, or functions, leading to the
confusion witnessed in #17593. This is easily fixed by only
recommending names in the same namespace, using the
`nameSpacesRelated` function.
Fixes #17593.
Diffstat (limited to 'testsuite/tests/rename/should_fail')
-rw-r--r-- | testsuite/tests/rename/should_fail/T17593.hs | 9 | ||||
-rw-r--r-- | testsuite/tests/rename/should_fail/T17593.stderr | 7 | ||||
-rw-r--r-- | testsuite/tests/rename/should_fail/all.T | 1 |
3 files changed, 17 insertions, 0 deletions
diff --git a/testsuite/tests/rename/should_fail/T17593.hs b/testsuite/tests/rename/should_fail/T17593.hs new file mode 100644 index 0000000000..6e05343613 --- /dev/null +++ b/testsuite/tests/rename/should_fail/T17593.hs @@ -0,0 +1,9 @@ +{-# LANGUAGE StandaloneKindSignatures #-} +{-# LANGUAGE TypeOperators #-} +module T17593 where + +(<+>) :: Int +data (<+>) + +type MkT :: T +data T = MkT diff --git a/testsuite/tests/rename/should_fail/T17593.stderr b/testsuite/tests/rename/should_fail/T17593.stderr new file mode 100644 index 0000000000..005f6c9fd4 --- /dev/null +++ b/testsuite/tests/rename/should_fail/T17593.stderr @@ -0,0 +1,7 @@ + +T17593.hs:5:1: error: + The type signature for â<+>â lacks an accompanying binding + +T17593.hs:8:6: error: + The standalone kind signature for âMkTâ + lacks an accompanying binding diff --git a/testsuite/tests/rename/should_fail/all.T b/testsuite/tests/rename/should_fail/all.T index c36c4cfcf9..179ff13560 100644 --- a/testsuite/tests/rename/should_fail/all.T +++ b/testsuite/tests/rename/should_fail/all.T @@ -152,3 +152,4 @@ test('T16385', normal, compile_fail, ['']) test('T16504', normal, compile_fail, ['']) test('T14548', normal, compile_fail, ['']) test('T16610', normal, compile_fail, ['']) +test('T17593', normal, compile_fail, ['']) |