Kotlin: sealed class cannot "contain" data classes? Why?
<p>OK, now that Kotlin is officially out and I am starting to play with it again, I am quite confused that I need to choose between the advantages of <code>sealed</code> and <code>data</code> but somehow can't have both.</p>

<p>This, for example, seems to make sense to me, but does not compile:</p>

<pre><code>sealed class Expr {
    data class Const(val number: Double) : Expr()
    data class Sum(val expr1 : Expr, val expr2 : Expr) : Expr()
}
</code></pre>

<p>because the data classes cannot extend other classes.</p>

<p>Is there something I am missing?</p>