David Glasser
05/15/2023, 11:01 PMinline fun <R> runFOrReturnFooError(f: () -> R): R =
if (someCondition) {
f()
} else {
FooError()
}
such that R is allowed to be any of the interfaces that FooError implementsRaphael TEYSSANDIER
05/15/2023, 11:40 PMinline fun <R : FooError> runFOrReturnFooError(f: () -> R): R
work ?sciack
05/16/2023, 10:27 AMResult
class?<R: in FooError>
but not sure if works well.where
condition all must match.