Im investigating the use of
when
I have a sealed class of values and want to identify each case as shown below
*when*(x) {
*is* SealedInitial -> doNothing()
*is* SealedOne -> something(x.value)
*is* SealedTwo -> somethingElse(x.value)
*else* -> doNothing()
}
I have to perform this test "All Over" my application, however the only constant check I will always need is
the first one, e.g.
*is* SealedInitial -> doNothing()
I would like to have thi scase handled by a super class so that all my Sub Classes do not need to keep coding that line
Is this possible? To have a
when
statement "extend" a super
when
?