From ff3f918d1c9685857d3ba4bb0dc119616e89cbe6 Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Mon, 21 Dec 2015 20:25:08 +0100 Subject: [PATCH] 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 --- compiler/main/GhcMake.hs | 8 +++----- testsuite/tests/cabal/cabal07/cabal07.stderr | 6 +++--- testsuite/tests/driver/driver063.stderr | 4 ++-- testsuite/tests/ghc-e/should_run/T2636.stderr | 4 ++-- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/compiler/main/GhcMake.hs b/compiler/main/GhcMake.hs index 41d4f1c592..843def1192 100644 --- a/compiler/main/GhcMake.hs +++ b/compiler/main/GhcMake.hs @@ -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, diff --git a/testsuite/tests/cabal/cabal07/cabal07.stderr b/testsuite/tests/cabal/cabal07/cabal07.stderr index 097f23fdc8..b3cfe5b152 100644 --- a/testsuite/tests/cabal/cabal07/cabal07.stderr +++ b/testsuite/tests/cabal/cabal07/cabal07.stderr @@ -1,6 +1,6 @@ -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. diff --git a/testsuite/tests/driver/driver063.stderr b/testsuite/tests/driver/driver063.stderr index 25488b80e9..84ff5b6dbb 100644 --- a/testsuite/tests/driver/driver063.stderr +++ b/testsuite/tests/driver/driver063.stderr @@ -1,4 +1,4 @@ -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. diff --git a/testsuite/tests/ghc-e/should_run/T2636.stderr b/testsuite/tests/ghc-e/should_run/T2636.stderr index 98c109e92d..1a7912735c 100644 --- a/testsuite/tests/ghc-e/should_run/T2636.stderr +++ b/testsuite/tests/ghc-e/should_run/T2636.stderr @@ -1,4 +1,4 @@ -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. -- GitLab