Skip to content

RPC codegen support inherit methods #140

Open
@martin-ncs

Description

The current codegen only supports methods defined inline, so we can't extend the RPC definition interface, which is useful for re-using method definitions.

Here's a quick example:

interface SharedCalls {
    suspend fun inherit()
}

interface DefinitionRpc : RPC, SharedCalls {
    suspend fun inline()
}

suspend fun executeRpc() {
    val http = HttpClient {
        installRPC()
    }
    val rpc = http.rpc().withService<DefinitionRpc>()

    // client code expects these to work
    rpc.inline()
    rpc.inherit()
}

As the codegen wont generate the inheritmethod so the class DefinitionRpcClient wont compile, leading into this error:

Class 'DefinitionRpcClient' is not abstract and does not implement abstract member public abstract suspend fun inherit()

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions