#2049: GHCi doesn't fully load previously broken modules
------------------------+---------------------------------------------------
    Reporter:  ajd      |       Owner:         
        Type:  bug      |      Status:  new    
    Priority:  normal   |   Component:  GHCi   
     Version:  6.8.2    |    Severity:  normal 
    Keywords:           |    Testcase:         
Architecture:  Unknown  |          Os:  Unknown
------------------------+---------------------------------------------------
 Scenario:

 I have a project with three modules: Mod1, Mod2 and Mod3. Mod3 calls an
 undefined function and so shouldn't load. I call GHCi as

 ghci Mod3.hs

 The output looks like this:

  GHCi, version 6.8.2: http://www.haskell.org/ghc/  :? for help
  Loading package base ... linking ... done.
  [1 of 3] Compiling Mod1             ( Mod1.hs, interpreted )
  [2 of 3] Compiling Mod2             ( Mod2.hs, interpreted )
  [3 of 3] Compiling Mod3             ( Mod3.hs, interpreted )

  Mod3.hs:6:6: Not in scope: `foo'

  Mod3.hs:6:12: Not in scope: `barf'
  Failed, modules loaded: Mod2, Mod1.

 The problem comes when I edit the file using GHCi's :e command and then
 reload with :r. The output looks like this (which is strange in itself,
 because the modules are listed in the wrong order):

  *Mod2> :r
  [3 of 3] Compiling Mod3             ( Mod3.hs, interpreted )
  Ok, modules loaded: Mod2, Mod3, Mod1.

 The problem is this: when I call a function from Mod3 from the GHCi
 toplevel, I get a "not in scope" error. I can call the function as
 "Mod3.<function name>" but "Mod3" does not show up in GHCi's tab
 completion. I don't believe that this is the correct behavior.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2049>
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