clang's cpp causes incorrect line numbers in type errors
If I run GHC on
{-# LANGUAGE CPP
#-}
module Foo where
foo :: String
foo = True
I get an error
Foo.hs:7:7:
Couldn't match type ‘Bool’ with ‘[Char]’
Expected type: String
Actual type: Bool
In the expression: True
In an equation for ‘foo’: foo = True
but the type error is on line 6, not line 7. It seems to have something to do with the fact that line 2 starts with a #
since the error is reported correctly if I make the language pragma a single line.
GHC on linux reports the correct location, as does GHC on OS X if I use any other language pragma, so I'm pretty sure this is another instance of clang's cpp
causing problems for us.
Trac metadata
Trac field | Value |
---|---|
Version | 7.10.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |