-
-
Notifications
You must be signed in to change notification settings - Fork 286
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backport for 0.9.x branch Fixes #695
- Loading branch information
Showing
3 changed files
with
58 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
syntax = "proto3"; | ||
|
||
package com.thesamet.proto.e2e; | ||
|
||
message OneOfFieldNamedEmpty { | ||
|
||
oneof content { | ||
Foo foo = 1; | ||
Bar empty = 2; // tests that we avoid a conflict with the `Empty` case object | ||
Empty baz = 3; // Message called `Empty` is fine. | ||
} | ||
|
||
message Foo {} | ||
message Bar {} | ||
message Empty {} | ||
} | ||
|
||
message OneOfNameOnSameLevel { | ||
|
||
Options options = 1; | ||
|
||
message Options { | ||
|
||
// sealed trait will be named FooOptionsOneof to avoid conflict with | ||
// FooOptions | ||
oneof foo_options { | ||
FooOptions for = 1; | ||
BarOptions bar = 2; | ||
} | ||
|
||
message FooOptions { } | ||
|
||
message BarOptions { | ||
// Works fine when using same name as | ||
// the enclosing message. | ||
oneof bar_options { | ||
uint64 baz1 = 1; | ||
Empty bar2 = 2; | ||
} | ||
|
||
} | ||
|
||
} | ||
|
||
message Empty {} | ||
} |