Kotlin optional generic parameter : <p>Here is the problem I am trying to resolve, I am trying to use a void type as a generic type:</p>

<pre><code>class Parent {
    private abstract class Item&lt;out T&gt;(val data: T)
    // This subclass should contain data
    private class ItemContent(val data: String): Item&lt;String&gt;(data)
    // This subclass doesn't contain data
    private class ItemNoContent: Item&lt;Any?&gt;(null)
}
</code></pre>

<p>Some base classes like ItemNoContent doesn't contain meaningful data so I make ItemNoContent extends Item(null). It works but I feel that the use of Any? and null is inappropriate here. Is there a more Kotlin way to solve this optional generic problem? </p>
