Hi,
I am using -Yrangepos with specs2 in order to be able to extract exact pieces of text from the interpolated bits when using string interpolation.
At the same time I am trying to use macros to generate
matchers for case classes. Unfortunately I run into position validation errors which I don't know how to fix:
[info] ======= Position error
[info] Synthetic tree [2336] contains nonsynthetic tree [2095]
[info] == Enclosing tree [2336] of type ValDef at [234]HelloWorldSpec.scala
[info]
[info] [L 13 ] #2336 [234] ValDef // term $1$
[info]
[info] == Enclosed tree [2095] of type Block at [218:229]HelloWorldSpec.scala
[info]
[info] [L 13 ] #2095 [218:229] Block // [Cat].name("
Is there a way to fix those errors by "forcing" a range position on the tree that is generated by the macro call? My guess was that being able to apply c.macroApplication.pos to the whole tree would be fine but that doesn't seem to be working.
Thanks.
Eric.