I'm wondering, why can't a class get an access to a companion object's field?
class MyClass {
println(val1) // not found, why?
}
object MyClass {
val val1 = "str"
}
It should, it should even have an access to the private fields of object MyClass
.