Can Result be used as a return type in a function? The following code snippet will yield an error:
fun foo(): Result { // error ‘kotlin.Result’ cannot be used as a return type
return Result.success(“foo”)
}
Can Result be used as a return type in a function? The following code snippet will yield an error:
fun foo(): Result { // error ‘kotlin.Result’ cannot be used as a return type
return Result.success(“foo”)
}