[GHC] #10044: Wrong line number reported with CPP and line beginning with #

GHC ghc-devs at haskell.org
Thu Jan 29 19:17:00 UTC 2015


#10044: Wrong line number reported with CPP and line beginning with #
-------------------------------------+-------------------------------------
              Reporter:  goldfire    |             Owner:
                  Type:  bug         |            Status:  new
              Priority:  low         |         Milestone:
             Component:  Compiler    |           Version:  7.10.1-rc2
              Keywords:              |  Operating System:  Unknown/Multiple
          Architecture:              |   Type of failure:  None/Unknown
  Unknown/Multiple                   |        Blocked By:
             Test Case:              |   Related Tickets:
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------
 If I compile

 {{{
 {-# LANGUAGE CPP #-}

 module Bug where

 {-
   # hi there!
 -}

 *

 }}}

 I'm told of a parse error for the `*` on line 10. But that `*` is line 9!

 The problem is that, with `CPP` on, the line number counter gets confused
 if a line begins with a #, perhaps after whitespace.

 I actually hit this and was confused in real code.

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


More information about the ghc-tickets mailing list