From the scala compiler help, I would have thought that "-Xprint:MyPhase" would do just that, but despite the fact that the plugin does it's job, and that I know it makes log output, I still don't see any output from coming from scalac when it runs. All I see are "[[syntax trees at end of MyPhase]] ..." Since logging seems to simply involve calling log("..."), I can't imagine what I would be doing wrong in the code that produces the log output. As an ugly work-around I can still do System.out.println(), but if there is a log() method, than I have to assume that it's actually meant to do something ...
1 Answer
-Ylog:<phase>
Use scalac -Y to see all the "private" options.
2 Comments
Sebastien Diot
Thank you! I just looked at Borachio, and you seem to have found a way to generate Scala code in your compiler plugin. I had a question asking for that here: stackoverflow.com/questions/7625765/… to which Kevin Wright answered that it is not possible. Would you be so kind and tell us how it works?
Paul Butcher
Kevin is entirely correct - although he is working on a way to fix the problem, I believe. Borachio "solves" the problem by generating source code which is then compiled in a separate invocation of the compiler. I've hidden most of the complexity involved in this behind an sbt plugin.