dave08
05/27/2024, 10:08 AMfun FooBase.resolveNew(other: FooBase) = when(this) {
is Foo1 -> when(other) {
is Foo1 -> ...
...
}
is Foo2 -> when(other) {
is Foo1 -> ...
...
}
}
is it preferred just to do this:
fun FooBase.resolveNew(other: FooBase) = when(this) {
this is Foo1 && other is Foo1 ->
...
}
if there are some common branches between the this
types? What does everybody do in this case?Javier
05/27/2024, 10:24 AMdave08
05/27/2024, 12:05 PM