summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWojciech Baranowski <wbaranowski@protonmail.com>2019-04-23 11:44:57 +0300
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-04-29 21:02:38 -0400
commite8bf8834ccd4c39628785962576565e5fe240218 (patch)
tree5758b7afb9ed9c9cd5ebcaf4a59b326269e2b343
parentfb9408dd779f53e2d13dd18638814118f6ca0cac (diff)
downloadhaskell-e8bf8834ccd4c39628785962576565e5fe240218.tar.gz
osa1's patch: consistent suggestion message
-rw-r--r--compiler/rename/RnEnv.hs7
-rw-r--r--testsuite/tests/parser/should_fail/readFail001.stderr4
2 files changed, 6 insertions, 5 deletions
diff --git a/compiler/rename/RnEnv.hs b/compiler/rename/RnEnv.hs
index 7f12e05816..fe0623e140 100644
--- a/compiler/rename/RnEnv.hs
+++ b/compiler/rename/RnEnv.hs
@@ -1503,15 +1503,16 @@ lookupBindGroupOcc ctxt what rdr_name
[n] -> text "Perhaps you meant" <+>
quotes (ppr n) <+>
parens (pprDefinedAt n)
- _ -> text "Perhaps you meant one of these:" <+>
- pprWithCommas (\x -> quotes (ppr x) <+> parens (pprDefinedAt x))
- similar_names
+ _ -> sep [ text "Perhaps you meant one of these:"
+ , nest 2 (pprWithCommas pp_item similar_names) ]
where
similar_names
= fuzzyLookup (unpackFS $ occNameFS $ rdrNameOcc rdr_name)
$ map (\x -> ((unpackFS $ occNameFS $ nameOccName x), x))
names_in_scope
+ pp_item x = quotes (ppr x) <+> parens (pprDefinedAt x)
+
---------------
lookupLocalTcNames :: HsSigCtxt -> SDoc -> RdrName -> RnM [(RdrName, Name)]
diff --git a/testsuite/tests/parser/should_fail/readFail001.stderr b/testsuite/tests/parser/should_fail/readFail001.stderr
index df2b920c54..f88eaac23b 100644
--- a/testsuite/tests/parser/should_fail/readFail001.stderr
+++ b/testsuite/tests/parser/should_fail/readFail001.stderr
@@ -1,8 +1,8 @@
readFail001.hs:25:11: error:
The fixity signature for ‘+#’ lacks an accompanying binding
- Perhaps you meant one of these: ‘+’ (Defined in ‘GHC.Num’),
- ‘++’ (Defined in ‘GHC.Base’)
+ Perhaps you meant one of these:
+ ‘+’ (Defined in ‘GHC.Num’), ‘++’ (Defined in ‘GHC.Base’)
readFail001.hs:38:32: error:
Not in scope: type constructor or class ‘Leaf’