Problem with simple trait abstract property


package Objects.Traits

fun main(args : Array<String>){
  var adam = Cowboy(“Adam”)

trait Shooting {
  abstract var name : String
  fun does(){
  print("$name can Shoot")

class Cowboy (name : String): Shooting{
  override var name = name

According to this, above code should work. Instead they generate


Exception in thread “main” java.lang.IllegalAccessError: Objects.Traits.Cowboy.getName()Ljava/lang/String;
     at Objects.Traits.Shooting$$TImpl.does(Traits.kt:11)
     at Objects.Traits.Cowboy.does(Traits.kt)
     at Objects.Traits.namespace.main(Traits.kt:5)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(
     at java.lang.reflect.Method.invoke(
     at com.intellij.rt.execution.application.AppMain.main(


It's a bug with visibility modifiers. We are working on it: