考虑以下代码:
class SomeClass {
companion object {
val str = "My String"
object AnotherObject {
fun foo(str: String) {
return str + //companion object's str
}
}
}
}
如何SomeClass::companion object::str
参考AnotherObject::foo
?
请尝试如下: