summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghci/should_fail
diff options
context:
space:
mode:
authorSean D Gillespie <sean@mistersg.net>2018-06-17 11:22:20 -0400
committerBen Gamari <ben@smart-cactus.org>2018-06-17 12:41:17 -0400
commitdf0f148feae4c3b9653260edff843d561d6d5918 (patch)
tree3ad522f40192f0f25d7a10ee1ac1a9623e8d0e95 /testsuite/tests/ghci/should_fail
parentccd8ce405db89142932daea3fdace8814b110798 (diff)
downloadhaskell-df0f148feae4c3b9653260edff843d561d6d5918.tar.gz
Improve error message when importing an unusable package
If a module cannot be found because it is ignored or from an unusable package, report this to the user and the reason it is unusable. Currently, GHC displays the standard "Cannot find module error". For example: ``` <no location info>: error: Could not find module ‘Control.Monad.Random’ Perhaps you meant Control.Monad.Reader (from mtl-2.2.2) Control.Monad.Cont (from mtl-2.2.2) Control.Monad.Error (from mtl-2.2.2) ``` GHC does, however, indicate unusable/ignored packages with the -v flag: ``` package MonadRandom-0.5.1-1421RgpXdhC8e8UI7D3emA is unusable due to missing dependencies: fail-4.9.0.0-BAHmj60kS5K7NVhhKpm9J5 ``` With this change, I took that message and added it to the output of the "Cannot find module" message. Reviewers: bgamari, dfeuer Reviewed By: bgamari Subscribers: Phyx, dfeuer, rwbarton, thomie, carter GHC Trac Issues: #4806 Differential Revision: https://phabricator.haskell.org/D4783
Diffstat (limited to 'testsuite/tests/ghci/should_fail')
-rw-r--r--testsuite/tests/ghci/should_fail/T15055.stderr4
1 files changed, 2 insertions, 2 deletions
diff --git a/testsuite/tests/ghci/should_fail/T15055.stderr b/testsuite/tests/ghci/should_fail/T15055.stderr
index daba7c7e53..fbf540edfd 100644
--- a/testsuite/tests/ghci/should_fail/T15055.stderr
+++ b/testsuite/tests/ghci/should_fail/T15055.stderr
@@ -1,6 +1,6 @@
-<no location info>:
- Could not find module ‘GHC’
+<no location info>: error:
+ Could not load module ‘GHC’
It is a member of the hidden package ‘ghc-8.5’.
You can run ‘:set -package ghc’ to expose it.
(Note: this unloads all the modules in the current scope.)