请查看代码:
suspend fun <T : Any?> await(f: (Handler<AsyncResult<T>>) -> Unit) : T {
return awaitResult<T> {
f(it)
}
}
await<Account> { accountService.get(1, it) } // (*)
是否可以通过这种方式重写(*)行(我想消除丑陋的“ it”语法):
await<Account>(accountService.get(1))
// or just
await<Account> accountService.get(1)