[GHC] #2542: runghc does not infer module file extensions

GHC trac at galois.com
Mon Aug 25 15:57:46 EDT 2008


#2542: runghc does not infer module file extensions
----------------------+-----------------------------------------------------
 Reporter:  judah     |          Owner:  igloo  
     Type:  bug       |         Status:  new    
 Priority:  high      |      Milestone:  6.10.1 
Component:  Compiler  |        Version:  6.8.3  
 Severity:  normal    |     Resolution:         
 Keywords:            |     Difficulty:  Unknown
 Testcase:            |   Architecture:  Unknown
       Os:  Unknown   |  
----------------------+-----------------------------------------------------
Changes (by igloo):

  * priority:  normal => high
  * milestone:  => 6.10.1

Comment:

 OK, I've (locally) fixed this for filenames like "foo.hs", but for
 "Setup.hs" (where "Setup" looks like a module name) we get:
 {{{
 $ runghc Setup

 Setup.hs:2:7:
     File name does not match module name:
     Saw: `Main'
     Expected: `Setup'
 }}}
 which mirrors
 {{{
 $ ghc --make Setup

 Setup.hs:2:7:
     File name does not match module name:
     Saw: `Main'
     Expected: `Setup'
 }}}

 This was a deliberate behaviour change, but I think that it was a mistake.
 If we really do want this to fail with the above message, then I think
 `ghc --make foo` should fail with "Bad module name".

 I would prefer that all of these succeed, though, despite the module name
 not matching the filename. The "ghc --make Setup" and "runhaskell Setup"
 cases are particularly motivating.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2542#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the Glasgow-haskell-bugs mailing list