Skip to content
New issue

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

oneof not working #18

Closed
mingchuno opened this issue Apr 14, 2015 · 2 comments
Closed

oneof not working #18

mingchuno opened this issue Apr 14, 2015 · 2 comments

Comments

@mingchuno
Copy link

I cannot compile a simple oneof message:

message Test {
  oneof haha_type {
    string a = 1;
    string b = 2;
  }
}

with the errors

[error] Expected "required", "optional", or "repeated".
[error] Missing field number.

@mingchuno
Copy link
Author

I have tried to git clone your project and run e2e.sh, which lead to the same error:

[info] Compiling 7 protobuf files to /home/mcor/dev/ScalaPB/e2e/target/scala-2.10/src_managed/main/compiled_protobuf,/home/mcor/dev/ScalaPB/e2e/target/scala-2.10/src_managed/main/compiled_protobuf
[info] Compiling schema /home/mcor/dev/ScalaPB/e2e/src/main/protobuf/custom_types.proto
[info] Compiling schema /home/mcor/dev/ScalaPB/e2e/src/main/protobuf/defaults.proto
[info] Compiling schema /home/mcor/dev/ScalaPB/e2e/src/main/protobuf/enum.proto
[info] Compiling schema /home/mcor/dev/ScalaPB/e2e/src/main/protobuf/flat.proto
[info] Compiling schema /home/mcor/dev/ScalaPB/e2e/src/main/protobuf/one_of.proto
[info] Compiling schema /home/mcor/dev/ScalaPB/e2e/src/main/protobuf/names.proto
[info] Compiling schema /home/mcor/dev/ScalaPB/e2e/src/main/protobuf/repeatables.proto
[error] one_of.proto:9:5: Expected "required", "optional", or "repeated".
[error] one_of.proto:9:21: Missing field number.
[error] flat.proto: Import "one_of.proto" was not found or had errors.
[error] flat.proto:21:12: "OneofTest" is not defined.
java.lang.RuntimeException: protoc returned exit code: 1
    at scala.sys.package$.error(package.scala:27)
    at com.trueaccord.scalapb.ScalaPbPlugin$.com$trueaccord$scalapb$ScalaPbPlugin$$compile(ScalaPbPlugin.scala:110)
    at com.trueaccord.scalapb.ScalaPbPlugin$$anonfun$sourceGeneratorTask$1$$anonfun$14.apply(ScalaPbPlugin.scala:139)
    at com.trueaccord.scalapb.ScalaPbPlugin$$anonfun$sourceGeneratorTask$1$$anonfun$14.apply(ScalaPbPlugin.scala:138)
    at sbt.FileFunction$$anonfun$cached$1.apply(Tracked.scala:186)
    at sbt.FileFunction$$anonfun$cached$1.apply(Tracked.scala:186)
    at sbt.FileFunction$$anonfun$cached$2$$anonfun$apply$3$$anonfun$apply$4.apply(Tracked.scala:200)
    at sbt.FileFunction$$anonfun$cached$2$$anonfun$apply$3$$anonfun$apply$4.apply(Tracked.scala:196)
    at sbt.Difference.apply(Tracked.scala:175)
    at sbt.Difference.apply(Tracked.scala:157)
    at sbt.FileFunction$$anonfun$cached$2$$anonfun$apply$3.apply(Tracked.scala:196)
    at sbt.FileFunction$$anonfun$cached$2$$anonfun$apply$3.apply(Tracked.scala:195)
    at sbt.Difference.apply(Tracked.scala:175)
    at sbt.Difference.apply(Tracked.scala:151)
    at sbt.FileFunction$$anonfun$cached$2.apply(Tracked.scala:195)
    at sbt.FileFunction$$anonfun$cached$2.apply(Tracked.scala:193)
    at com.trueaccord.scalapb.ScalaPbPlugin$$anonfun$sourceGeneratorTask$1.apply(ScalaPbPlugin.scala:141)
    at com.trueaccord.scalapb.ScalaPbPlugin$$anonfun$sourceGeneratorTask$1.apply(ScalaPbPlugin.scala:136)
    at scala.Function7$$anonfun$tupled$1.apply(Function7.scala:35)
    at scala.Function7$$anonfun$tupled$1.apply(Function7.scala:34)
    at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
    at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
    at sbt.std.Transform$$anon$4.work(System.scala:63)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
    at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
    at sbt.Execute.work(Execute.scala:235)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
    at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
    at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
[error] (protobuf:protobufScalaGenerate) protoc returned exit code: 1
[error] Total time: 0 s, completed Apr 14, 2015 11:50:45 AM

@mingchuno
Copy link
Author

just found out that my protoc version is 2.5.0 which doesnot have oneof feature. closing this issue

thesamet added a commit that referenced this issue May 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant