Opened 2 years ago

Closed 2 years ago

#6003 closed bug (duplicate)

ghci should complain when the user imports non-existent modules

Reported by: dagit Owned by:
Priority: normal Milestone:
Component: GHCi Version: 7.4.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets: #5836

Description

I was surprised today when I tried to import a module that wasn't installed locally and ghci didn't issue a warning so I assume it loaded. I didn't even notice that the prompt didn't change. I tried to use functions in the module I thought was imported and that's how I learned it didn't actually succeed at the import.

Here is an example to reproduce what I saw:

$ ghci
GHCi, version 7.4.1: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Prelude> import Control.Monad.Pizza
Prelude> 

Thanks!

Change History (2)

comment:1 Changed 2 years ago by creswick

This appears to be a regression, in 7.2.1, the following happens:

GHCi, version 7.2.1: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package ffi-1.0 ... linking ... done.
Prelude> import Control.Monad.Pizza

<no location info>:
    Could not find module `Control.Monad.Pizza'
    Perhaps you meant
      Control.Monad.Fix (from base)
      Control.Monad.Zip (from base)
      Control.Monad.ST (from base)
    Use -v to see a list of the files searched for.
Prelude> 

comment:2 Changed 2 years ago by pcapriotti

  • Difficulty set to Unknown
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #5836.

Note: See TracTickets for help on using tickets.