Are there any plans to support function overloadin...
# kotlinx-rpc
a
Are there any plans to support function overloading for
@Rpc
annotated interfaces?
a
Hi! No, no such plans What's your use-case?
a
It's just a common language feature that I have come to use a lot, and not supporting it seems more like a limitation But for this specific scenario, I would like to have
Copy code
fun positions(): ListPosition
fun positions(department: String) : ListPosition
I am forced to change this to
Copy code
sealed interface Params
data object All: Params
data class Department(val uid: String): Parama

fun position(params: Params) : ListPosition
While it works, it feels more like a work around 😔
a
I mean, you can also do that as positionsByDepartment This is a consensus in RPC libs, that allows for protocols to use function names as ids, which just removes a lot of headaches Also API evolution with overloading is a mess, if we'd want to have any proper backward compatibility for the app