kirillrakhman
06/12/2017, 8:46 AMsealed class Foo {
class A : Foo()
class B : Foo()
data class C(val s: String) : Foo()
override fun equals(other: Any?) = other != null && other.javaClass == javaClass
override fun hashCode() = javaClass.hashCode()
override fun toString() = javaClass.simpleName
}