diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2021-03-29 16:54:05 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-04-01 00:40:07 -0400 |
commit | 0219297c874659169507fa67c469d65bb9fabb1b (patch) | |
tree | db583178e0f7942dec42d9b6e4bced6cba348f59 /compiler/GHC/Iface | |
parent | 29326979eeb887e97f18bdc7852bb33a5b437362 (diff) | |
download | haskell-0219297c874659169507fa67c469d65bb9fabb1b.tar.gz |
Move unit DBs in UnitEnv
Also make the HomeUnit optional to keep the field strict and prepare for
UnitEnvs without a HomeUnit (e.g. in Plugins envs, cf #14335).
Diffstat (limited to 'compiler/GHC/Iface')
-rw-r--r-- | compiler/GHC/Iface/Load.hs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/compiler/GHC/Iface/Load.hs b/compiler/GHC/Iface/Load.hs index 8cd93e058f..2cd2e15819 100644 --- a/compiler/GHC/Iface/Load.hs +++ b/compiler/GHC/Iface/Load.hs @@ -1414,7 +1414,7 @@ cantFindErr using_cabal cannot_find _ unit_env profile tried_these mod_name find = ptext cannot_find <+> quotes (ppr mod_name) $$ more_info where - home_unit = ue_home_unit unit_env + mhome_unit = ue_home_unit unit_env more_info = case find_result of NoPackage pkg @@ -1424,7 +1424,13 @@ cantFindErr using_cabal cannot_find _ unit_env profile tried_these mod_name find NotFound { fr_paths = files, fr_pkg = mb_pkg , fr_mods_hidden = mod_hiddens, fr_pkgs_hidden = pkg_hiddens , fr_unusables = unusables, fr_suggestions = suggest } - | Just pkg <- mb_pkg, not (isHomeUnit home_unit pkg) + | Just pkg <- mb_pkg + , Nothing <- mhome_unit -- no home-unit + -> not_found_in_package pkg files + + | Just pkg <- mb_pkg + , Just home_unit <- mhome_unit -- there is a home-unit but the + , not (isHomeUnit home_unit pkg) -- module isn't from it -> not_found_in_package pkg files | not (null suggest) |