Skip to content

Weird error from running runghc on an invalid input filename

I had files random.hs and random.hi and random.o, so I accidentally entered the following command with tab completion.

rwbarton@morphism:/tmp$ runghc random.
Warning: ignoring unrecognised input `random.'

random.:1:33:
    Not in scope: ‘main’
    Perhaps you meant ‘min’ (imported from Prelude)

#7765 (closed) is surely related, but with HEAD (well, rather old, but at least new enough to contain the fix for #7765 (closed)), the error is not really any better:

rwbarton@morphism:/tmp$ ~/ghc/inplace/bin/runghc random.
Warning: ignoring unrecognised input `random.'

random.:0:53: error:
    Variable not in scope: main :: IO a0
    Perhaps you meant ‘min’ (imported from Prelude)
Trac metadata
Trac field Value
Version 7.8.4
Type Bug
TypeOfFailure OtherFailure
Priority low
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information