Hi,
This happens only if ‘prop’ is protected.
trait Trait{
protected var prop : String
fun accessProp(){
var v = prop
}
}
class Class : Trait{
protected override var prop: String = “”
}
Test fun test() {
var c = Class()
c.accessProp()
}
“java.lang.IllegalAccessError: tests.Class.getProp()Ljava/lang/String;”