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 was trying to workaround #614 by providing custom serializer to Nothing type. Seems it's currently impossible to provide custom serializer for type passed as generic type parameter.
Example:
@Serializable
sealed class CommandExecutionResult<out Result> {
@Serializable
class Success<out Result>(
val result: Result
) : CommandExecutionResult<Result>() {
override fun <T> map(function: (Result) -> T): Success<T> {
return Success(function(result))
}
}
@Serializable
class Failure(
val reason: FailureReason
) : CommandExecutionResult<@Serializer(NothingSerializer::class) Nothing>() {
override fun <T> map(function: (Nothing) -> T): Failure = this
}
}
The text was updated successfully, but these errors were encountered:
I was trying to workaround #614 by providing custom serializer to Nothing type. Seems it's currently impossible to provide custom serializer for type passed as generic type parameter.
Example:
The text was updated successfully, but these errors were encountered: