title: Creating a new instance of a KClass
body: <p>I have a Kotlin class whose primary (and only) constructor is empty.</p>
  
  <p>I have a reference to this class:</p>
  
  <pre><code>val kClass: KClass&lt;MyClass&gt; = MyClass::class
  </code></pre>
  
  <p>How do I create an instance of this class using reflection?</p>
  
  <p>In Java I would do <code>myClass.newInstance()</code> but it seems in Kotlin I need to find the constructor first:</p>
  
  <pre><code>kClass.constructors.first().call()
  </code></pre>
  
  <p>I have seen mention of <code>primaryConstructor</code> in <a href="https://youtrack.jetbrains.com/issue/KT-6728" rel="noreferrer">some bug reports</a> but it's not showing up in my IDE.</p>