[GHC] #15702: "-main-is" flag is broken for recent ghc-head

GHC ghc-devs at haskell.org
Wed Oct 3 21:36:33 UTC 2018


#15702: "-main-is" flag is broken for recent ghc-head
-------------------------------------+-------------------------------------
           Reporter:  terrorjack     |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:  8.6.1
          Component:  Compiler       |           Version:  8.6.1
           Keywords:                 |  Operating System:  Linux
       Architecture:  x86_64         |   Type of failure:  Incorrect
  (amd64)                            |  error/warning at compile-time
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 Here is a minimal reproduction:

 Main.hs:

 {{{
 main :: IO ()
 main = putStrLn "Main"
 }}}

 Main2.hs:

 {{{
 module Main2 where

 import Main

 main2 :: IO ()
 main2 = do
   putStrLn "Main2"
   main
 }}}

 Run ghc with something like
 `/home/terrorjack/.stack/programs/x86_64-linux/ghc-8.7.20181003/bin/ghc
 -main-is Main2.main2 Main.hs Main2.hs`, and it reports the following
 error:

 {{{
 [1 of 2] Compiling Main             ( Main.hs, Main.o )

 Main.hs:1:1: error:
     Not in scope: ‘main2’
     Perhaps you meant ‘main’ (line 2)
   |
 1 | main :: IO ()
   | ^
 }}}

 Meanwhile, the exact same flags work for ghc-8.6.1, and also a previous
 ghc-head build on d90946cea1357d3e99805c27dab1e811785a4088, so some
 accidental breakage might be in a recent commit.

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15702>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list