@elidable won't work, because the code still has to compile :-(
The best that I can come up with is to move the code into a separate directory, which I add to unmanagedSources for all Scala versions apart from 2.9.1. Eugh. Any better suggestions?
There are times when I really miss the C pre-processor...
--
paul.butcher->msgCount++
Snetterton, Castle Combe, Cadwell Park...
Who says I have a one track mind?
http://www.paulbutcher.com/
LinkedIn: http://www.linkedin.com/in/paulbutcher
MSN: pa...@paulbutcher.com
AIM: paulrabutcher
Skype: paulrabutcher
> I'm cross-compiling my project for several different Scala versions. I have one isolated section of code that fails to compile under 2.9.1 because of a compiler bug. Is there any way to exclude a section of code when compiling with a specific compiler version?
>
> @elidable won't work, because the code still has to compile :-(
>
> The best that I can come up with is to move the code into a separate directory, which I add to unmanagedSources for all Scala versions apart from 2.9.1. Eugh. Any better suggestions?
This isn't too bad, really. There are two alternatives that I can think of. First, you could modify the code to work under all compiler versions. I assume you've tried this, though.
Second, you could use a preprocessor. The error messages aren't as good because it isn't integrated with the compiler, though. See the sbinary build for one way of doing this using fmpp.
https://github.com/harrah/sbinary/blob/master/project/SBinaryProject.scala
-Mark
Thanks, Mark - I'll check that out.