I want to get java.lang.Class
for Scala package object:
app/package.scala:
package object app {
}
app/Main.scala:
package app
object Main extends App {
val _ = app.getClass
}
Compilation fails with:
object getClass is not a member of package app Note that app extends Any, not AnyRef. Such types can participate in value classes, but instances cannot appear in singleton types or in reference comparisons.