I wonder how to get a class object for an object type in Scala. Ok, that is a mouth full because of the double meaning for object. So here an example which will fail:
object Main
{
private [this] val TAG = classOf [Main].getName;
} // Main
If Main
was class it works perfectly. Any ideas?
object
s have exactly one instance and therefore you callgetClass
. Thanks. – Radices