Skip to content

CPP+QuasiQuotes confuses compilation errors' line numbers

doing an #include of multi-line files inside QuasiQuotes makes GHC report wrong line numbers on errors occurring in normal code which is after the said #include.

myHtmlsTemplate = [$multiLineStr|
#include "template.html"
|]

somethingElse :: NoSuchType
somethingElse = 7

The example code will fail compiling with: Not in scope: type constructor or class NoSuchType'`, but will not report the correct line number of the error.

Trac metadata
Trac field Value
Version 6.12.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC yairchu@gmail.com
Operating system MacOS X
Architecture x86
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information