Join Slack
Powered by
Sealed with Enum (<https://antonioleiva.com/sealed...
# announcements
e
Eugen Martynov
08/30/2019, 1:12 PM
Sealed with Enum (
https://antonioleiva.com/sealed-classes-kotlin/
)
d
df
08/30/2019, 2:12 PM
Maybe the example is just to simple to show the advantage of sealed classes but having
fun execute(x: Int): Int
defined as a method of Operation (could be an interface) the whole when block would turn into
op.execute(x)
which is imo the better approach.
Open in Slack
Previous
Next