Opened 9 years ago

Closed 9 years ago

#5249 closed task (fixed)

Non-understandable comment in compiler/main/GHC.hs

Reported by: dterei Owned by: simonmar
Priority: highest Milestone: 7.2.1
Component: Compiler Version: 7.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

the file compiler/main/GHC.hs contains a comment that follows:

-- | Request information about a loaded 'Module'
getModuleInfo :: GhcMonad m => Module -> m (Maybe ModuleInfo)  -- XXX: Maybe X
getModuleInfo mdl = withSession $ \hsc_env -> do
  let mg = hsc_mod_graph hsc_env
  if mdl `elem` map ms_mod mg
	then liftIO $ getHomeModuleInfo hsc_env (moduleName mdl)
	else do
  {- if isHomeModule (hsc_dflags hsc_env) mdl
	then return Nothing
	else -} liftIO $ getPackageModuleInfo hsc_env mdl
   -- getPackageModuleInfo will attempt to find the interface, so
   -- we don't want to call it for a home module, just in case there
   -- was a problem loading the module and the interface doesn't
   -- exist... hence the isHomeModule test here.  (ToDo: reinstate)

Neither myself or Simon M know what the comment means. We should figure it out and fix up this code and comment accordingly. The XXX: Maybe X doesn't make sense either.

Change History (4)

comment:1 Changed 9 years ago by igloo

Milestone: 7.2.1
Priority: normalhighest

Let's figure this out now, or if we can't, just remove it.

comment:2 Changed 9 years ago by simonmar

Owner: set to simonmar

comment:3 Changed 9 years ago by marlowsd@…

commit 614a17f912259c3d0450bf29a0e31494161b523b

Author: Simon Marlow <marlowsd@gmail.com>
Date:   Tue Jul 19 16:05:17 2011 +0100

    note that we don't understand a comment (#5249)

 compiler/main/GHC.hs |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

comment:4 Changed 9 years ago by simonmar

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.