today's puzzle really makes me want proper sum types, sealed classes aren't cutting it. You can't put an enum class inside a sealed class because it can't inherit 😞
i
ilya.gorbunov
12/12/2020, 3:14 PM
I suppose sealed interfaces would solve this problem
e
ephemient
12/12/2020, 3:40 PM
does it have to be an enum class? `object`works inside a sealed class
n
Nir
12/12/2020, 7:18 PM
@ephemient good point, I used object and that makes it a bit nicer
Nir
12/12/2020, 7:19 PM
Still not that comfortable with object
Nir
12/12/2020, 7:19 PM
this case is obviously the tip of the iceberg really of issues with sealed classes (vs sum types) but at least there's a decent solution here