dzaitsev
12/11/2016, 8:10 AMopen class Foo(protected var bar: String = “hello”)
If I write a test in Java, I can just call foo.getBar()
and foo.setBar(s)
because protected is visible in package, but if I write test in Kotlin, I can’t do that because bar
becomes invisible.
Is having smth like class TestFoo(bar: String = "hello") : Foo(bar) {
var publicBar: String
get() = bar
set(value) { bar = value }
}
the only way?