-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use fully qualified name when generating messages (#104)
Fixes #47 For the following protobuf where the `oneof` field had the same name as message, the companion object definition would shadow the `oneof` class instead of the `message` class. This patch fixes it by fully qualifying the `message` class name. **Input:** ```protobuf syntax = "proto3"; package foobar; message Value { oneof value { int32 int_val = 1; string str_val = 2; } } ``` **Before:** ```kotlin package foobar data class Value( val value: Value<*>? = null, override val unknownFields: Map<Int, pbandk.UnknownField> = emptyMap() ) : pbandk.Message { sealed class Value<V>(value: V) : pbandk.Message.OneOf<V>(value) { ... } ... companion object : pbandk.Message.Companion<Value> { ... } ... } ``` **After:** ```kotlin package foobar data class Value( val value: Value<*>? = null, override val unknownFields: Map<Int, pbandk.UnknownField> = emptyMap() ) : pbandk.Message { sealed class Value<V>(value: V) : pbandk.Message.OneOf<V>(value) { ... } ... companion object : pbandk.Message.Companion<foobar.Value> { ... } ... } ```
- Loading branch information
Showing
23 changed files
with
3,727 additions
and
2,717 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.