From df1a0c0c62b6433b2b4584a133a6d92491b71e08 Mon Sep 17 00:00:00 2001 From: Ben Gamari <bgamari.foss@gmail.com> Date: Mon, 27 Nov 2017 14:00:06 -0500 Subject: [PATCH] typecheck: Consistently use pretty quotes in error messages Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4241 --- compiler/typecheck/TcRnExports.hs | 15 +++++++++------ .../tests/backpack/should_fail/bkpfail48.stderr | 2 +- testsuite/tests/module/mod135.stderr | 3 ++- testsuite/tests/module/mod8.stderr | 2 +- .../tests/rename/should_fail/rnfail028.stderr | 3 ++- .../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 e2b6a61bfa28..f89206503e60 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 9c991d6fc945..cb0740d8bf3a 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 a08f93cb6716..197bc93c5479 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 cba84c850294..d06d6903ac58 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 f09cda3f3376..848e39e920d5 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 f4258de0b4fa..897db5366194 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 -- GitLab