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

Duplicate item name when oneof name matches nested item name #1244

Open
davidzeng0 opened this issue Feb 18, 2025 · 0 comments
Open

Duplicate item name when oneof name matches nested item name #1244

davidzeng0 opened this issue Feb 18, 2025 · 0 comments

Comments

@davidzeng0
Copy link

The following code generates

message Outer {
	message Inner {}

	oneof inner {
		Inner inner_one = 1;
		Inner inner_two = 2;
	}
}
// This file is @generated by prost-build.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Outer {
    #[prost(oneof = "outer::Inner", tags = "1, 2")]
    pub inner: ::core::option::Option<outer::Inner>,
}
/// Nested message and enum types in `Outer`.
pub mod outer {
    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
    pub struct Inner {} // <-- CONFLICT!

    #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
    pub enum Inner { // <-- CONFLICT!
        #[prost(message, tag = "1")]
        InnerOne(Inner),
        #[prost(message, tag = "2")]
        InnerTwo(Inner),
    }
}
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