Skip to content

[GRPC] kotlin-multiplatform protoc plugin generates broken code #630

@AlexanderEggers

Description

@AlexanderEggers

Describe the bug
The generated code by the kotlin-multiplatform protoc plugins contains a lot of broken code when browsing the build folder.

For example that is the .ext.kt file for one of my protos:

/**
* Constructs a new message.
* ```
* val message = Id {
*    id = ...
* }
* ```
*/
operator fun Id.Companion.invoke(body: Id.Builder.() -> Unit): Id {
    val msg = IdInternal().apply(body)
    msg.checkRequiredFields()
    return msg
}

/**
* Copies the original message, including unknown fields.
* ```
* val copy = original.copy {
*    id = ...
* }
* ```
*/
fun Id.copy(body: Id.Builder.() -> Unit = {}): Id {
    return this.asInternal().copyInternal(body)
}

Neither the .Companion or .Builder exist anywhere. Is that intended?

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions