title: Kotlin Access Property Name from Delegate
body: <p>I'm writing a saving system for my game using kotlin delegated properties.</p>
  <p>Here is a small example</p>
  <pre><code>import kotlin.reflect.KProperty
  
  object Test {
      val test: Int by no_prop { 10 } // I want this
      val testTwo: Int by prop(::testTwo) { 10 } // I don't want this if possible
  }
  
  inline fun &lt;reified T : Any&gt; Test.no_prop(initializer: () -&gt; T) = TestProp&lt;T&gt;()
  
  inline fun &lt;reified T : Any&gt; Test.prop(prop: KProperty&lt;*&gt;, initializer: () -&gt; T): TestProp&lt;T&gt; {
      println(&quot;My saving key is ${this.javaClass.simpleName}.${prop.name}&quot;)
      return TestProp&lt;T&gt;()
  }
  
  class TestProp&lt;T : Any&gt; {
      operator fun getValue(thisRef: Any?, property: KProperty&lt;*&gt;) = 10 as T
      operator fun setValue(thisRef: Any?, property: KProperty&lt;*&gt;, value: T) {}
  }
  </code></pre>
  <p>My game uses a string key for saved properties. Its always <code>*callerClassName*.*propertyName*</code></p>
  <p>I was wondering if its possible through my delegate extension functions or the <code>TestProp</code> class to access the name of the property is delegating?</p>
  <p>Ex:
  It would be nice if the no_prop method could the property that called it was named &quot;test&quot;</p>
  <pre><code>val test: Int by no_prop { 10 }
  </code></pre>
  <p>The following is a workaround, but I'd like to avoid doing that for every property if possible</p>
  <pre><code>val testTwo: Int by prop(::testTwo) { 10 }
  </code></pre>