title: Collection<KProperty1<I,*>> How to get the property instance
body: <p>I'm currently using Reflection to inspect an element at runtime using the <code>class.memberProperties</code> function. The type of <code>properties</code> is <code>collection&lt;KProperty1&lt;I, *&gt;&gt;</code> so I run through each of the <code>KProperty</code> objects to find the one that I want by checking if the name is equal to "nameIWant", though I would much rather be able to get the instance of the property from the <code>KProperty</code> by using the <code>.get()</code> method on the <code>property</code>, so that then I could do a check such as:</p>
  
  <pre><code>if (property.get(receiver) is ClassIWant) {
    //Do something
  }
  </code></pre>
  
  <p>My code looks like this:</p>
  
  <pre><code>val properties = request.payload::class.memberProperties
    properties.forEach { property -&gt;
      run {
        if (property.name.equals("nameIWant")) {
  
        }
      }
    }
  </code></pre>
  
  <p>So far I've been trying to use the <code>.get()</code> method on the <code>KProperty1</code> type but it takes an argument <code>receiver</code> of type <code>Nothing</code>. I'm not able to work out what I need to pass in order to call the <code>.get()</code> method and get the particular instance of the property. I've also checked the documentation here: <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html" rel="nofollow noreferrer">https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property1/index.html</a> but it hasn't really helped at all.</p>