Thanks Nyavro for the answer.
It seems that the package object restricts access to its built-in member from the outside and to get full access to the package object, like ordinary objects, which we can do as follows:
package object app { val instance = this }
and use it like:
app.instance.getClass
source share