summaryrefslogtreecommitdiff
path: root/compiler/deSugar/DsUsage.hs
diff options
context:
space:
mode:
authorEdward Z. Yang <ezyang@cs.stanford.edu>2017-02-12 04:28:38 -0800
committerEdward Z. Yang <ezyang@cs.stanford.edu>2017-02-17 13:46:28 -0800
commit22dba98f2b22141d8238d7e7a42141495945f1cf (patch)
tree6d69dd6337e36d1076dfcaa57bc1c311d2373802 /compiler/deSugar/DsUsage.hs
parentca543154bbf0ec36ee2654050ee67a467420449f (diff)
downloadhaskell-22dba98f2b22141d8238d7e7a42141495945f1cf.tar.gz
Fix recompilation tracking on signatures.
Summary: Previously we weren't tracking these dependencies at all, because we couldn't "find" the interface for {A.H}. Now we've associated hole names to the correct module identity so we will pick them up. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: bgamari, austin Subscribers: thomie, snowleopard Differential Revision: https://phabricator.haskell.org/D3131
Diffstat (limited to 'compiler/deSugar/DsUsage.hs')
-rw-r--r--compiler/deSugar/DsUsage.hs15
1 files changed, 10 insertions, 5 deletions
diff --git a/compiler/deSugar/DsUsage.hs b/compiler/deSugar/DsUsage.hs
index 665f2933bb..da29ac0e6a 100644
--- a/compiler/deSugar/DsUsage.hs
+++ b/compiler/deSugar/DsUsage.hs
@@ -119,11 +119,16 @@ mk_mod_usage_info pit hsc_env this_mod direct_imports used_names
Nothing -> ASSERT2( isSystemName name, ppr name ) mv_map
-- See Note [Internal used_names]
- Just mod -> -- This lambda function is really just a
- -- specialised (++); originally came about to
- -- avoid quadratic behaviour (trac #2680)
- extendModuleEnvWith (\_ xs -> occ:xs) mv_map mod [occ]
- where occ = nameOccName name
+ Just mod ->
+ -- See Note [Identity versus semantic module]
+ let mod' = if isHoleModule mod
+ then mkModule this_pkg (moduleName mod)
+ else mod
+ -- This lambda function is really just a
+ -- specialised (++); originally came about to
+ -- avoid quadratic behaviour (trac #2680)
+ in extendModuleEnvWith (\_ xs -> occ:xs) mv_map mod' [occ]
+ where occ = nameOccName name
-- We want to create a Usage for a home module if
-- a) we used something from it; has something in used_names