[GHC] #12906: GHC fails to typecheck Main module without main

GHC ghc-devs at haskell.org
Mon Dec 5 01:40:17 UTC 2016


#12906: GHC fails to typecheck Main module without main
-------------------------------------+-------------------------------------
        Reporter:  dfeuer            |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  Other             |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by RyanGlScott):

 Well, you are right in that GHC //did// use to report more information—you
 just have to dig back a bit further:

 {{{
 $ /opt/ghc/7.4.2/bin/ghc Bug.hs
 [1 of 1] Compiling Main             ( Bug.hs, Bug.o )

 Bug.hs:1:1: The function `main' is not defined in module `Main'

 Bug.hs:4:7:
     Couldn't match expected type `String' with actual type `IO ()'
     In the return type of a call of `print'
     In the expression: print (reverse s + 1)
     In an equation for `x': x s = print (reverse s + 1)
 ryanglscott at T450s-Linux64 in ~/Documents/Hacking/Haskell
 $ /opt/ghc/7.6.3/bin/ghc Bug.hs
 [1 of 1] Compiling Main             ( Bug.hs, Bug.o )

 Bug.hs:1:1: The function `main' is not defined in module `Main'
 }}}

 So this happened sometime between GHC 7.4 and 7.6.

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


More information about the ghc-tickets mailing list