diff options
author | Phil Ruffwind <rf@rufflewind.com> | 2017-01-17 15:55:28 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-01-17 15:56:28 -0500 |
commit | e195add1f203a0e169a2ea6e58be8d7989e9e0a4 (patch) | |
tree | 708823a27800823acdc57875f0c9ec9cd3e46fa0 | |
parent | d5cd505bc484edee3dbd5d41fb7a27c2e18d528d (diff) | |
download | haskell-e195add1f203a0e169a2ea6e58be8d7989e9e0a4.tar.gz |
Unquote ‘import’ in bad import error message
In module ‘Prelude’:
‘True’ is a data constructor of ‘Bool’
To import it use
‘import’ Prelude( Bool( True ) )
The quotes around `import` don't make any sense.
Test Plan: manual
Reviewers: austin, mpickering, bgamari
Reviewed By: mpickering, bgamari
Subscribers: dfeuer, thomie
Differential Revision: https://phabricator.haskell.org/D2935
-rw-r--r-- | compiler/rename/RnNames.hs | 4 | ||||
-rw-r--r-- | testsuite/tests/module/mod90.stderr | 6 | ||||
-rw-r--r-- | testsuite/tests/rename/should_fail/T10668.stderr | 4 | ||||
-rw-r--r-- | testsuite/tests/rename/should_fail/T5385.stderr | 6 |
4 files changed, 10 insertions, 10 deletions
diff --git a/compiler/rename/RnNames.hs b/compiler/rename/RnNames.hs index 8a7529da1c..9d2de7439e 100644 --- a/compiler/rename/RnNames.hs +++ b/compiler/rename/RnNames.hs @@ -1488,11 +1488,11 @@ badImportItemErrDataCon dataType_occ iface decl_spec ie <+> text "is a data constructor of" <+> quotes dataType , text "To import it use" - , nest 2 $ quotes (text "import") + , nest 2 $ text "import" <+> ppr (is_mod decl_spec) <> parens_sp (dataType <> parens_sp datacon) , text "or" - , nest 2 $ quotes (text "import") + , nest 2 $ text "import" <+> ppr (is_mod decl_spec) <> parens_sp (dataType <> text "(..)") ] diff --git a/testsuite/tests/module/mod90.stderr b/testsuite/tests/module/mod90.stderr index 9febfe3628..78a0040303 100644 --- a/testsuite/tests/module/mod90.stderr +++ b/testsuite/tests/module/mod90.stderr @@ -1,8 +1,8 @@ -mod90.hs:3:16: +mod90.hs:3:16: error: In module ‘Prelude’: ‘Left’ is a data constructor of ‘Either’ To import it use - ‘import’ Prelude( Either( Left ) ) + import Prelude( Either( Left ) ) or - ‘import’ Prelude( Either(..) ) + import Prelude( Either(..) ) diff --git a/testsuite/tests/rename/should_fail/T10668.stderr b/testsuite/tests/rename/should_fail/T10668.stderr index 8c96fad1a8..4e602b28b4 100644 --- a/testsuite/tests/rename/should_fail/T10668.stderr +++ b/testsuite/tests/rename/should_fail/T10668.stderr @@ -3,6 +3,6 @@ T10668.hs:3:27: error: In module ‘Data.Type.Equality’: ‘Refl’ is a data constructor of ‘(:~:)’ To import it use - ‘import’ Data.Type.Equality( (:~:)( Refl ) ) + import Data.Type.Equality( (:~:)( Refl ) ) or - ‘import’ Data.Type.Equality( (:~:)(..) ) + import Data.Type.Equality( (:~:)(..) ) diff --git a/testsuite/tests/rename/should_fail/T5385.stderr b/testsuite/tests/rename/should_fail/T5385.stderr index 677c31ff3e..dd825c6119 100644 --- a/testsuite/tests/rename/should_fail/T5385.stderr +++ b/testsuite/tests/rename/should_fail/T5385.stderr @@ -1,8 +1,8 @@ -T5385.hs:3:16: +T5385.hs:3:16: error: In module ‘T5385a’: ‘(:::)’ is a data constructor of ‘T’ To import it use - ‘import’ T5385a( T( (:::) ) ) + import T5385a( T( (:::) ) ) or - ‘import’ T5385a( T(..) ) + import T5385a( T(..) ) |