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

containingOneOfName field does not give the name #15

Closed
henrymai opened this issue Mar 27, 2015 · 0 comments · Fixed by #16
Closed

containingOneOfName field does not give the name #15

henrymai opened this issue Mar 27, 2015 · 0 comments · Fixed by #16

Comments

@henrymai
Copy link

Currently containingOneOfName returns something like:
"Some(com.google.protobuf.Descriptors$OneofDescriptor@63eb32ed)"

The reason is because the oneof descriptor is being passed in instead of the name of the oneof descriptor.

https://github.com/trueaccord/ScalaPB/blob/a6cd42a9904ce1f8f9fa010df6da43676d0eeb66/compiler-plugin/src/main/scala/com/trueaccord/scalapb/compiler/ProtobufGenerator.scala

Line 790

Should be:
val oneof = field.containingOneOf.map(s => s"""Some("${s.getName()}")""").getOrElse("None")

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

Successfully merging a pull request may close this issue.

1 participant