hfhbd
07/17/2023, 10:36 AM@JvmInline
value class AsyncValue<T>(private inline val getter: suspend () -> T) {
constructor(queryResult: suspend () -> AsyncValue<T>) : this (getter = {
queryResult().getter()
})
}
With this code, the current usage of AsyncValue { //myCode }
needs to return AsyncValue
and not T
. Workaround is to use change all old code from AsyncValue { }
to AsyncValue(getter = { })
.Youssef Shoaib [MOD]
07/17/2023, 10:54 AMAsyncValue
and annotate the T
one with @OverloadResolutionByLambdaReturnType
Youssef Shoaib [MOD]
07/17/2023, 10:56 AMinline val
is a thing for value classes. Do you have any more info about that? Does it actually inline the lambda or something? I can't quite tell what's happening therehfhbd
07/17/2023, 11:19 AMhfhbd
07/17/2023, 11:20 AM