[GHC] #8956: Confusing error message due to ` #`-lines

GHC ghc-devs at haskell.org
Fri Apr 4 13:08:16 UTC 2014


#8956: Confusing error message due to ` #`-lines
-------------------------+-------------------------------------------------
       Reporter:  hvr    |             Owner:
           Type:  bug    |            Status:  new
       Priority:         |         Milestone:
  normal                 |           Version:  7.8.1-rc2
      Component:         |  Operating System:  Unknown/Multiple
  Compiler               |   Type of failure:  Incorrect warning at
       Keywords:         |  compile-time
   Architecture:         |         Test Case:
  Unknown/Multiple       |          Blocking:
     Difficulty:         |
  Unknown                |
     Blocked By:         |
Related Tickets:         |
-------------------------+-------------------------------------------------
 Consider the following two (invalid) modules `M1` and `M2`:

 {{{#!hs
  # 1 "<built-in>" 1
 module M1 where
 }}}

 and

 {{{#!hs
  # 1 "<built-in>" 1
 module M2 where
 }}}

 When those are compiled separately by GHC, they result in the following
 error:
 {{{
 $ ghc -c -Wall  M1.hs

 M1.hs:1:2: parse error on input ‘#’

 ghc -c -Wall  M2.hs

 M2.hs:1:2: parse error on input ‘#’
 }}}

 However, when compiled simultaneously, the modules get seemingly parsed as
 `Main`-modules (which then conflict with each others):

 {{{
 ghc --make -Wall  M1.hs M2.hs

 <no location info>:
     module ‘main:Main’ is defined in multiple files: M1.hs M2.hs
 }}}

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


More information about the ghc-tickets mailing list