rednifre
07/29/2024, 1:25 PMpublic interface CoroutineBindingScope<E> : CoroutineScope {
public suspend fun <V> Result<V, E>.bind(): V
}
Is there a way to add a bindNullable()
extension function for T?
that returns T
or throws, but that is only available inside that scope?
I can do it as a function, something like CoroutineBindingScope.bindNullable(T?)
, but is it possible to do this as a method?Joffrey
07/29/2024, 1:27 PMcontext(CoroutineBindingScope<E>)
suspend fun <E, V> Result<V, E>.bindNullable(): V {
// ...
}
But note that this requires enabling the feature with a compiler argument.Joffrey
07/29/2024, 1:29 PMrednifre
07/29/2024, 1:34 PMJoffrey
07/29/2024, 1:37 PM[JetBrains]
tag, I'm not part of the Kotlin team, I'm just a humble user 😅 so I don't really know when this is planned. I believe the priority for them was to stabilize K2 so far, hence why this kind of complex feature didn't get much traction, but now the efforts on those features are resuming little by little. That being said, this feature is very complex so it will take some timedmitriy.novozhilov
07/29/2024, 4:21 PMDaniel Pitts
07/29/2024, 9:02 PMdmitriy.novozhilov
07/30/2024, 6:14 AM2.X.0
) release happens after ~6 months after the previous one
So 2.1.20 will be approximately in August-September of 2025kqr
07/30/2024, 7:31 AMDaniel Pitts
07/30/2024, 1:51 PMkqr
07/30/2024, 2:19 PMDaniel Pitts
07/30/2024, 2:58 PMdmitriy.novozhilov
07/30/2024, 3:30 PMDaniel Pitts
07/30/2024, 3:33 PMdmitriy.novozhilov
07/30/2024, 3:34 PMDaniel Pitts
07/30/2024, 3:55 PMDaniel Pitts
07/30/2024, 3:55 PMJoffrey
07/30/2024, 3:57 PMdmitriy.novozhilov
07/30/2024, 3:57 PMDaniel Pitts
07/30/2024, 3:59 PMdmitriy.novozhilov
07/30/2024, 4:01 PM