Slackbot
11/24/2025, 5:59 PMy
11/24/2025, 6:57 PMsealed interface A {
val v1: Int
val v2: String
data class B1(override val v1: Int, override val v2: String) : A
data class B2(override val v1: Int, override val v2: String) : A
data class B3(override val v1: Int, override val v2: String) : A
}
and I need to do a .copy() in a couple of places.
this can also be expressed as
data class AK: CompiledGenericRule.Kind(val v1: Int, val v2: String, kind: K) {
enum class K { B1, B2, B3 }
}
which loses the class-level polymorphism, but is simpler to use and .copy() is no longer a problem. but I don't want to introduce this to a codebase where this pattern is not widely if there are some problems here.Kirill Grouchnikov
11/24/2025, 7:04 PMy
11/24/2025, 7:05 PMKirill Grouchnikov
11/24/2025, 7:06 PMy
11/24/2025, 7:06 PMKirill Grouchnikov
11/24/2025, 7:07 PMy
11/24/2025, 7:08 PM