I just checked the source code.
When Scala changed the name of the class file a few years ago, and people seem to have forgotten to update these classes accordingly.
So, I would answer:
At the very least, Location has no purpose, because it is impossible to get anything reasonable from it (except for exceptions), and Code without Location very limited. It works, although if you pass the class literal directly to Code :
import scala.mobile._ val c = new Code(classOf[scala.collection.mutable.StringBuilder]) c.apply[StringBuilder, String]("append")("Foo") c.apply[String]("toString")() // returns "Foo" c.apply[Int]("length")() // returns 3
It looks like another implementation in the standard reflection library is a bit better.
source share