Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 5,247
    • Issues 5,247
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 577
    • Merge requests 577
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #1205
Closed
Open
Issue created Mar 06, 2007 by guest@trac-guest

ghci reports functions not in scope after loading a .hs, if there is a .o present

I wanted to debug some code, so I fired up ghci and had this experience:

> :l foo.hs
...
> my_func 1 2 3

<interactive>:1:0: Not in scope: `my_func'

Apparently, this was because I had previously compiled the code, and ghci noticed the .o file and loaded that instead of the source file. As a result, anything not explicitly exported was not visible.

Once I quit, removed the .o, restarted ghci, and reloaded the file; it worked as I was expecting.

It seems to me that ":load foo.hs" should load foo.hs, with no funny business. Anything else is likely not doing what the user expects. I'd be fine with ":l foo" loading a compiled version if available, and I'm fine with imports from the code I'm loading a compiled version. But, when I explicitly say to load one file, and some other file is loaded instead; that seems like bad behavior.

Trac metadata
Trac field Value
Version 6.6
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component GHCi
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system Unknown
Architecture Unknown
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking