Incorrect parsing of declarations
|Reported by:||diatchki||Owned by:|
|Type of failure:||None/Unknown||Test Case:|
|Related Tickets:||Differential Rev(s):|
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.