#2682: Keep going after failed search for module in current directory
---------------------------------+------------------------------------------
    Reporter:  ajd               |        Owner:  simonmar        
        Type:  bug               |       Status:  closed          
    Priority:  normal            |    Milestone:  6.12 branch     
   Component:  GHCi              |      Version:  6.8.2           
    Severity:  minor             |   Resolution:  fixed           
    Keywords:                    |   Difficulty:  Unknown         
    Testcase:                    |           Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |  
---------------------------------+------------------------------------------
Changes (by simonmar):

  * status:  new => closed
  * resolution:  => fixed

Comment:

 Fixed:

 {{{
 Tue Apr 21 06:10:38 PDT 2009  Simon Marlow <[email protected]>
  * FIX #2682: banish silly cases of the "module Foo is not loaded" error
  Ignore-this: 15298691a63e13c63a68673202b1fc18

  In GHCi if you say 'import Foo' meaning to load a package module Foo,
  and Foo.hs is found on the search path, then GHCi replies "module Foo
  is not loaded", because it knows Foo refers to the source file rather
  than the package module, and you haven't loaded that module with
  :load.

  This is consistent with the usual module-finding semantics.  However,
  it isn't particularly useful.  And it leads to silly problems like not
  being able to start GHCi when you happen to be sitting in
  libraries/base, because GHCi thinks the Prelude hasn't been loaded.

  So now I've made a slight change to the way that 'import M' works: if
  M is loaded, then it refers to the loaded module, otherwise it looks
  for a package module M.  This does what the reporter of #2682 wanted,
  and since it turns an error condition into meaningful behaviour it
  can't break anything.

  The only undesirable consequence is that 'import M' might refer to a
  different M than ':load M'.  Hopefully that won't lead to confusion.
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2682#comment:7>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to