IllegalAccessError (when accessing protected trait var)

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;”

Please report bugs directly to issue tracker. Thank you!

I was just about to, but it seems it's already reported

Seems so. In this case, you can vote for it :)