krotoDC icon indicating copy to clipboard operation
krotoDC copied to clipboard

Problem when the name of a 'oneof' field matches the name of the message.

Open blue-hope opened this issue 1 year ago • 1 comments

Simple Example:

message Content {
  oneof Content {
    string text = 1;
  }
}

is converted into

@KrotoDC(forProto = a.b.c.Content::class)
public data class Content(
    public val Content: Content? = null,
) {
    public sealed interface Content {
        public data class Text(
            public val text: String = "",
        ) : Content
    }
}

occurs kotlin compile error.

This could be a minor issue because typically, the name of the 'oneof' field is not the same as the message's field. However, it may not be a forbidden action, so it requires support.

blue-hope avatar Apr 27 '23 06:04 blue-hope