You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i.e. should we change or offer the following as part of the api:
fun <V> binding(block:ResultBinding.() ->V): Result<V, *>
This would allow 2 things:
no more specifying the types when declaring a binding block:
val result = binding {
val x = doSomething().bind()
val y = doSomethingElse().bind()
x + y
}
doSomething and doSomethingElse can have error types that dont extend from the same type.
The downside of this is that now the ide will see the type of result in the above example as Result<Int, *>
But is that so bad?
If we wanted to add this, would it make more sense to replace the current binding with this? or offer a second function. What would they be named? bindingAny? bindingExplicit?
The text was updated successfully, but these errors were encountered:
I'm not a fan of allowing people to shoot themselves in the foot with anonymous types. If they want this behaviour it's fairly trivial for them to write their own extension function with the wildcard types themselves.
i.e. should we change or offer the following as part of the api:
This would allow 2 things:
doSomething
anddoSomethingElse
can have error types that dont extend from the same type.The downside of this is that now the ide will see the type of
result
in the above example asResult<Int, *>
But is that so bad?
If we wanted to add this, would it make more sense to replace the current binding with this? or offer a second function. What would they be named?
bindingAny
?bindingExplicit
?The text was updated successfully, but these errors were encountered: