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

No warning or error for fields with the same index #81

Open
nefilim opened this issue Jun 19, 2014 · 3 comments
Open

No warning or error for fields with the same index #81

nefilim opened this issue Jun 19, 2014 · 3 comments
Labels

Comments

@nefilim
Copy link
Contributor

nefilim commented Jun 19, 2014

for instance

messages A {
optional a = 1;
optional b = 1;
}

code gets happily generated, i'm guessing this will have runtime problems. a warning or better yet, an error would be good?

@SandroGrzicic
Copy link
Owner

What happens if you run the same example with protoc?

@nefilim
Copy link
Contributor Author

nefilim commented Jun 22, 2014

[peter@nefilim ~]$ cat test.proto
message A {
optional uint32 a = 1;
optional uint32 b = 1;
}
[peter@nefilim ~]$ protoc --java_out=. test.proto
test.proto:3:21: Field number 1 has already been used in "A" by field "a".

@SandroGrzicic
Copy link
Owner

Alright, marking this as a bug. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants