summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2017-11-27 14:00:06 -0500
committerBen Gamari <ben@smart-cactus.org>2017-11-27 20:28:37 -0500
commitdf1a0c0c62b6433b2b4584a133a6d92491b71e08 (patch)
treec92357efd996b9362f730e652826c80e131af4e9
parent4efe5fed407067d4b27000e0cf4092cfb6f7502b (diff)
downloadhaskell-df1a0c0c62b6433b2b4584a133a6d92491b71e08.tar.gz
typecheck: Consistently use pretty quotes in error messages
Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4241
-rw-r--r--compiler/typecheck/TcRnExports.hs15
-rw-r--r--testsuite/tests/backpack/should_fail/bkpfail48.stderr2
-rw-r--r--testsuite/tests/module/mod135.stderr3
-rw-r--r--testsuite/tests/module/mod8.stderr2
-rw-r--r--testsuite/tests/rename/should_fail/rnfail028.stderr3
-rw-r--r--testsuite/tests/typecheck/should_fail/MissingExportList03.stderr5
6 files changed, 18 insertions, 12 deletions
diff --git a/compiler/typecheck/TcRnExports.hs b/compiler/typecheck/TcRnExports.hs
index e2b6a61bfa..f89206503e 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 9c991d6fc9..cb0740d8bf 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 a08f93cb67..197bc93c54 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 cba84c8502..d06d6903ac 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 f09cda3f33..848e39e920 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 f4258de0b4..897db53661 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