#4055: Incorrect parsing of declarations
---------------------------------+------------------------------------------
    Reporter:  diatchki          |       Owner:                   
        Type:  bug               |      Status:  new              
    Priority:  normal            |   Component:  Compiler (Parser)
     Version:  6.12.2            |    Keywords:                   
          Os:  Unknown/Multiple  |    Testcase:                   
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown     
---------------------------------+------------------------------------------
 GHC's parser seems to accept incorrect Haskell programs, which leads to
 very confusing error messages.  Here is an example:

 {{{
 f x = T

 g 1 = 10
 g x

 data T = T
 }}}
 When trying to compile this GHC reports:

 {{{
 test.hs:1:6: Not in scope: data constructor `T'
 }}}

 This happened in much larger module, where I had forgotten to complete one
 of the equations for a function, but ended up looking for what is wrong
 with the (completely unrelated) "data" declaration.

 This might be related to Template Haskell because a smaller example---a
 file containing only the literal 1---results in complaints about  some
 template Haskell type not being in the Num class.

 I am compiling the module without any pragmas or flags, so I would not
 think that TH is enabled.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4055>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to