-
-
Notifications
You must be signed in to change notification settings - Fork 285
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
Support for sealed traits #67
Comments
I wonder if it makes sense to automatically have all the messages in the file extend the sealed trait, or individual messages should be opted in via |
Consider that it is a sealed trait and all extending messages have to be generated in the same At least in my use case it would require copy+pasting |
Do you have any plan to implement this? |
In your example the sealed trait in the preamble has methods prefixed with |
Or was that just an example? I guess my initial example for this issue doesn't require any defs on the sealed trait, since it's just a grouping trait for pattern matching. |
It's just an example. You can leave the sealed trait empty. There's no On Fri, Apr 15, 2016, 5:26 AM Per Wiklander [email protected]
|
thanks! This is great! |
Use case: Exhaustive pattern matching of related domain events.
A file level option like:
option (scalapb.message).sealedTrait = "DomainEvent";
This would cause all messages in the
.proto
file to be put in the same.scala
file along with asealed trait DomainEvent {}
The text was updated successfully, but these errors were encountered: