Kotlin: How can I create a "static" inheritable function? : <p>For example, I want to have a function <code>example()</code> on a type <code>Child</code> that extends <code>Parent</code> so that I can use the function on both.</p>

<pre><code>Child.example()
Parent.example()
</code></pre>

<p>The first "obvious" way to do this is through the companion object of <code>Parent</code>, but this doesn't allow <code>example()</code> for <code>Child</code>.</p>

<p>The second way I tried was defining an extension function on <code>Parent.Companion</code>, which is inconvenient because you are forced to define a companion object. It also doesn't allow <code>example()</code> for <code>Child</code>.</p>

<p>Does anybody know how I can do this?</p>
