mglukhikh
import mypackage.Foo.* sealed class Foo { class Bar(val x: Int) : Foo() } fun test() { val foo = Bar(5) when (foo) { is Bar -> println(foo.x) } }