#6132: Can't use both shebang line and #ifdef declarations in the same file.
---------------------------------+------------------------------------------
    Reporter:  gfxmonk           |       Owner:                           
        Type:  bug               |      Status:  new                      
    Priority:  normal            |   Milestone:  7.8.1                    
   Component:  Compiler          |     Version:  7.0.4                    
    Keywords:                    |          Os:  Unknown/Multiple         
Architecture:  Unknown/Multiple  |     Failure:  GHC rejects valid program
  Difficulty:  Unknown           |    Testcase:                           
   Blockedby:                    |    Blocking:                           
     Related:                    |  
---------------------------------+------------------------------------------
Changes (by igloo):

  * difficulty:  => Unknown
  * milestone:  => 7.8.1


Comment:

 If you put the conditional part into a separate module with a `{-#
 LANGUAGE CPP #-}` pragma then it would work, but I suspect you don't want
 to do that so that it's easy to move the script around. Similarly a custom
 preprocessor would make moving it around harder.

 I can't see a better immediate fix than:
  * When running CPP, if the file starts with #! then copy all but the
 first line to a temporary file and run CPP on that instead. (actually,
 we'd want a blank first line so that line numbers work out).

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