[GHC] #13889: GHC 8.0.2 panics when trying a simple snippet involving Parsec

GHC ghc-devs at haskell.org
Wed Jul 5 15:17:41 UTC 2017


#13889: GHC 8.0.2 panics when trying a simple snippet involving Parsec
-------------------------------------+-------------------------------------
        Reporter:  timmyjose         |                Owner:  (none)
            Type:  bug               |               Status:  closed
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.2
      Resolution:  duplicate         |             Keywords:  parsec,
                                     |  ghc8.0.2, macOS Sierra
Operating System:  MacOS X           |         Architecture:  x86_64
 Type of failure:  Compile-time      |  (amd64)
  crash or panic                     |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #13106            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by RyanGlScott):

 * status:  new => closed
 * resolution:   => duplicate
 * related:   => #13106


Comment:

 Thanks for the bug report.

 This is a duplicate of #13106, which has been fixed in GHC 8.2.1. In
 8.2.1, I get a reasonable error message:

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

 Bug.hs:1:1: error:
     The IO action ‘main’ is not defined in module ‘Main’
   |
 1 | import Text.ParserCombinators.Parsec hiding (spaces)
   | ^

 Bug.hs:4:10: error:
     Variable not in scope: anyOf :: [Char] -> Parser Char
   |
 4 | symbol = anyOf "!$%&|*+-/:<=?>@^_^~#"
   |          ^^^^^
 }}}

 Alternatively, you can make the panic go away in 8.0.2 by just adding
 `module SimpleParser where` at the top of the file (the lack of `main` is
 confusing GHC in 8.0.2).

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


More information about the ghc-tickets mailing list