Commit ff3f918d authored by Edward Z. Yang's avatar Edward Z. Yang Committed by Ben Gamari

Fix #11256 by not immediately erroring if we can't find a module.

Test Plan: validate

Reviewers: austin, bgamari, thomie

Reviewed By: bgamari, thomie

Differential Revision: https://phabricator.haskell.org/D1669

GHC Trac Issues: #11256
parent 55250a63
......@@ -1886,13 +1886,11 @@ summariseModule hsc_env old_summary_map is_boot (L loc wanted_mod)
| isJust (ml_hs_file location) ->
-- Home package
just_found location mod
| otherwise ->
-- Drop external-pkg
ASSERT(moduleUnitId mod /= thisPackage dflags)
return Nothing
err -> return $ Just $ Left $ noModError dflags loc wanted_mod err
_ -> return Nothing
-- Not found
-- (If it is TRULY not found at all, we'll
-- error when we actually try to compile)
just_found location mod = do
-- Adjust location to point to the hs-boot source file,
......
Q.hs:3:8: error:
Could not find module ‘Data.Set’
It is a member of the hidden package ‘containers-0.5.6.3@containers-0.5.6.3’.
Q.hs:3:1: error:
Failed to load interface for ‘Data.Set’
It is a member of the hidden package ‘containers-0.5.7.0’.
Perhaps you need to add ‘containers’ to the build-depends in your .cabal file.
Use -v to see a list of the files searched for.
D063.hs:2:8:
Could not find module ‘A063’
D063.hs:2:1: error:
Failed to load interface for ‘A063’
It is not a module in the current program, or in any known package.
T2636.hs:1:8:
Could not find module ‘MissingModule’
T2636.hs:1:1: error:
Failed to load interface for ‘MissingModule’
Use -v to see a list of the files searched for.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment