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

GHC ghc-devs at haskell.org
Wed Oct 3 22:18:34 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
      Resolution:                    |             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:                    |
-------------------------------------+-------------------------------------

Comment (by cdsmith):

 Arguably, I think this should never have worked in the first place.  Here,
 Main.hs is relying on the default header to export `main` because of its
 name, even though `main` is no longer the entry point for this program.
 Adding an explicit export would fix it.

 If this was done in existing code, though, this does mean there's a
 backward-compatibility problem for that patch.  That's unfortunate.

 The error message is also weird.  There's a special error message for the
 `main` case that says something like "The IO action main is not defined in
 module Main", but `-main-is` seems to disable it and fall back to a
 generic "Not in scope".  (This was pre-existing behavior, though.  It's
 not new in GHC head.)

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


More information about the ghc-tickets mailing list