-msImports :: ModSummary -> [(FilePath, -- Importing module
- Module, -- Imported module
- IsBootInterface)] -- {-# SOURCE #-} import or not
-msImports s = [(f, m,True) | m <- ms_srcimps s]
- ++ [(f, m,False) | m <- ms_imps s]
+msDeps :: ModSummary -> [(FilePath, -- Importing module
+ Module, -- Imported module
+ IsBootInterface)] -- {-# SOURCE #-} import or not
+-- (msDeps s) returns the dependencies of the ModSummary s.
+-- A wrinkle is that for a {-# SOURCE #-} import we return
+-- *both* the hs-boot file
+-- *and* the source file
+-- as "dependencies". That ensures that the list of all relevant
+-- modules always contains B.hs if it contains B.hs-boot.
+-- Remember, this pass isn't doing the topological sort. It's
+-- just gathering the list of all relevant ModSummaries
+msDeps s = concat [ [(f, m, True), (f,m,False)] | m <- ms_srcimps s]
+ ++ [(f,m,False) | m <- ms_imps s]