-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
When using a message to define an object without any attribute (empty message), the generated kotlin code is broken for the toPlatform and toKotlin generated functions
To Reproduce
Steps to reproduce the behavior:
- Checkout the sample bug branch with modified proto file Add empty message to proto definition sebaslogen/kotlinx-rpc#1
- Navigate to samples/grpc-app
- Run
./gradlew bufGenerateMainto generate kotlin code - Inspect the generated file
samples/grpc-app/build/protoBuild/generated/main/kotlin-multiplatform/_rpc_internal/ImageRecognizer.kt
Actual outcome
Generated code (this code fails to compile):
fun DismissAction.toPlatform(): ImageRecognizerOuterClass.DismissAction {
return ImageRecognizerOuterClass.DismissAction.newBuilder().apply
}
fun ImageRecognizerOuterClass.DismissAction.toKotlin(): DismissAction {
return DismissAction
}Expected behavior
Generated code compiles without errors
Example of how compiling code could look like:
fun DismissAction.toPlatform(): ImageRecognizerOuterClass.DismissAction {
return ImageRecognizerOuterClass.DismissAction.newBuilder().build()
}
fun ImageRecognizerOuterClass.DismissAction.toKotlin(): DismissAction {
return DismissAction {}
}Additional context
Tested on version "0.10.0-grpc-121" of this library
phansier
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working