4

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 1

4

-Ylog:<phase>

Use scalac -Y to see all the "private" options.

Sign up to request clarification or add additional context in comments.

2 Comments

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?
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.