[commit: ghc] master: typecheck: Consistently use pretty quotes in error messages (df1a0c0)
git at git.haskell.org
git at git.haskell.org
Tue Nov 28 01:29:56 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/df1a0c0c62b6433b2b4584a133a6d92491b71e08/ghc
>---------------------------------------------------------------
commit df1a0c0c62b6433b2b4584a133a6d92491b71e08
Author: Ben Gamari <bgamari.foss at gmail.com>
Date: Mon Nov 27 14:00:06 2017 -0500
typecheck: Consistently use pretty quotes in error messages
Subscribers: rwbarton, thomie, carter
Differential Revision: https://phabricator.haskell.org/D4241
>---------------------------------------------------------------
df1a0c0c62b6433b2b4584a133a6d92491b71e08
compiler/typecheck/TcRnExports.hs | 15 +++++++++------
testsuite/tests/backpack/should_fail/bkpfail48.stderr | 2 +-
testsuite/tests/module/mod135.stderr | 3 ++-
testsuite/tests/module/mod8.stderr | 2 +-
testsuite/tests/rename/should_fail/rnfail028.stderr | 3 ++-
.../typecheck/should_fail/MissingExportList03.stderr | 5 +++--
6 files changed, 18 insertions(+), 12 deletions(-)
diff --git a/compiler/typecheck/TcRnExports.hs b/compiler/typecheck/TcRnExports.hs
index e2b6a61..f892065 100644
--- a/compiler/typecheck/TcRnExports.hs
+++ b/compiler/typecheck/TcRnExports.hs
@@ -31,7 +31,6 @@ import Outputable
import ConLike
import DataCon
import PatSyn
-import FastString
import Maybes
import Util (capitalise)
@@ -657,17 +656,21 @@ dupModuleExport mod
moduleNotImported :: ModuleName -> SDoc
moduleNotImported mod
- = text "The export item `module" <+> ppr mod <>
- text "' is not imported"
+ = hsep [text "The export item",
+ quotes (text "module" <+> ppr mod),
+ text "is not imported"]
nullModuleExport :: ModuleName -> SDoc
nullModuleExport mod
- = text "The export item `module" <+> ppr mod <> ptext (sLit "' exports nothing")
+ = hsep [text "The export item",
+ quotes (text "module" <+> ppr mod),
+ text "exports nothing"]
missingModuleExportWarn :: ModuleName -> SDoc
missingModuleExportWarn mod
- = text "The export item `module" <+> ppr mod <>
- ptext (sLit "' is missing an export list")
+ = hsep [text "The export item",
+ quotes (text "module" <+> ppr mod),
+ text "is missing an export list"]
dodgyExportWarn :: Name -> SDoc
diff --git a/testsuite/tests/backpack/should_fail/bkpfail48.stderr b/testsuite/tests/backpack/should_fail/bkpfail48.stderr
index 9c991d6..cb0740d 100644
--- a/testsuite/tests/backpack/should_fail/bkpfail48.stderr
+++ b/testsuite/tests/backpack/should_fail/bkpfail48.stderr
@@ -4,7 +4,7 @@
[1 of 1] Compiling A[sig] ( p/A.hsig, nothing )
bkpfail48.bkp:6:18: error:
- • The export item `module Data.Bool' is not imported
+ • The export item ‘module Data.Bool’ is not imported
• while merging the signatures from:
• q[A=<A>]:A
• ...and the local signature for A
diff --git a/testsuite/tests/module/mod135.stderr b/testsuite/tests/module/mod135.stderr
index a08f93c..197bc93 100644
--- a/testsuite/tests/module/mod135.stderr
+++ b/testsuite/tests/module/mod135.stderr
@@ -1,2 +1,3 @@
-mod135.hs:2:11: The export item `module Data.List' is not imported
+mod135.hs:2:11: error:
+ The export item ‘module Data.List’ is not imported
diff --git a/testsuite/tests/module/mod8.stderr b/testsuite/tests/module/mod8.stderr
index cba84c8..d06d690 100644
--- a/testsuite/tests/module/mod8.stderr
+++ b/testsuite/tests/module/mod8.stderr
@@ -1,2 +1,2 @@
-mod8.hs:2:10: The export item `module N' is not imported
+mod8.hs:2:10: error: The export item ‘module N’ is not imported
diff --git a/testsuite/tests/rename/should_fail/rnfail028.stderr b/testsuite/tests/rename/should_fail/rnfail028.stderr
index f09cda3..848e39e 100644
--- a/testsuite/tests/rename/should_fail/rnfail028.stderr
+++ b/testsuite/tests/rename/should_fail/rnfail028.stderr
@@ -1,2 +1,3 @@
-rnfail028.hs:2:21: The export item `module List' is not imported
+rnfail028.hs:2:21: error:
+ The export item ‘module List’ is not imported
diff --git a/testsuite/tests/typecheck/should_fail/MissingExportList03.stderr b/testsuite/tests/typecheck/should_fail/MissingExportList03.stderr
index f4258de..897db53 100644
--- a/testsuite/tests/typecheck/should_fail/MissingExportList03.stderr
+++ b/testsuite/tests/typecheck/should_fail/MissingExportList03.stderr
@@ -1,2 +1,3 @@
-MissingExportList03.hs:1:1: [-Wmissing-export-lists, -Werror=missing-export-lists]
- The export item `module ShouldFail' is missing an export list
+
+MissingExportList03.hs:1:1: error: [-Wmissing-export-lists, -Werror=missing-export-lists]
+ The export item ‘module ShouldFail’ is missing an export list
More information about the ghc-commits
mailing list