We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If your protobuf looks like this (test project is located here https://github.com/lewissk/test_protobuf/tree/master):
syntax = "proto2"; package test; option java_package = "test"; option cc_enable_arenas = true; enum ContentCategory { IAB1_1 = 2; IAB11 = 191; }
Then you run:
sbt compile
You will get the following error:
[error] /Users/xxx/test/protobuf_scala_test/target/src_managed/main/compiled_protobuf/test/ContentCategory.scala:11: method isIab11 is defined twice [error] conflicting symbols both originated in file '/Users/xxx/protobuf_scala_test/target/src_managed/main/compiled_protobuf/test/ContentCategory.scala' [error] def isIab11: Boolean = false [error] ^ [error] one error found [error] (compile:compileIncremental) Compilation failed
Because the scala it generates is like so:
// Generated by the Scala Plugin for the Protocol Buffer Compiler. // Do not edit! package test import com.trueaccord.scalapb.Descriptors sealed trait ContentCategory extends com.trueaccord.scalapb.GeneratedEnum { def isIab11: Boolean = false def isIab11: Boolean = false } object ContentCategory extends com.trueaccord.scalapb.GeneratedEnumCompanion[ContentCategory] { @SerialVersionUID(0L) case object IAB1_1 extends ContentCategory { val id = 2 val name = "IAB1_1" override def isIab11: Boolean = true } @SerialVersionUID(0L) case object IAB11 extends ContentCategory { val id = 191 val name = "IAB11" override def isIab11: Boolean = true } lazy val values = Seq(IAB1_1, IAB11) def fromValue(value: Int): ContentCategory = value match { case 2 => IAB1_1 case 191 => IAB11 } lazy val descriptor = new Descriptors.EnumDescriptor(0, "ContentCategory", this) }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
If your protobuf looks like this (test project is located here https://github.com/lewissk/test_protobuf/tree/master):
Then you run:
sbt compile
You will get the following error:
Because the scala it generates is like so:
The text was updated successfully, but these errors were encountered: