scala/scala — pull request #1817 by xeno-by (2012-12-25 02:08:35+00:00)
Title: adds c.introduceTopLevel

The first in the family of mutators for the global symbol table,
`introduceTopLevel` is capable of creating synthetic top-level
classes and modules.

The addition of nme.EMPTY_PACKAGE_NAME is necessary to let
programmers insert definitions into the empty package. That's explicitly
discouraged in the docs, but at times might come in handy.

This patch introduce workarounds to avoid incompatibilities with SBT.
First of all SBT doesn't like VirtualFiles having JFile set to null.
Secondly SBT gets confused when someone depends on synthetic files
added by c.introduceTopLevel.

Strictly speaking these problems require changes to SBT, and that will be
done later. However the main target of the patch is paradise/macros,
which needs to be useful immediately, therefore we apply workarounds.