scala/scala — pull request #2994 by xeno-by (2013-09-26 18:35:31+00:00)
Title: assorted fixes for bundles

This commit clearly establishes what bundles are. Previously it was
enough to just extend scala.reflect.macros.Macro, which created some
loopholes, but now scalac enforces that bundles:
1) Are static (not necessarily top-level, but just static)
2) Are traits (objects shouldn't be bundles anyway, and classes bring
complications with their ctors which require special treatment in
generated classes, so why support them if they don't bring anything
new to the table?)
3) Are monomorphic (again, this brings unnecessary complications wrt
auxiliary code generation, so I don't see merit in supporting
polymorphic bundles, whatever that a polymorphic bundle could mean)
4) Don't provide concrete implementation for Macro.c (if they do then
what is the point?)

Also fixes a couple issues. Firstly, bundles can now be nested as long
as they are static (which means that we can finally use bundles in REPL!).
Secondly, auxiliary code that's generated by the compiler alongside bundles
is now put into virtual compilation units with stable names, which solves
the infinite compilation problem in SBT 0.13.