ruiaylin / goprotobuf

Automatically exported from code.google.com/p/goprotobuf
Other
0 stars 0 forks source link

nested message type with enum inside generates bad go code, proto file attached. #2

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. save the attached proto file as addressbook.proto
2. protoc --go_out=. addressbook.proto
3. 6g addressbook.pb.go

What is the expected output?

Compile with no errors.

What do you see instead?

addressbook.pb.go:32: AddressBook_Person_PhoneType redeclared in this block
        previous declaration at addressbook.pb.go:11
addressbook.pb.go:34: AddressBook_Person_MOBILE redeclared in this block
        previous declaration at addressbook.pb.go:13
addressbook.pb.go:35: AddressBook_Person_HOME redeclared in this block
        previous declaration at addressbook.pb.go:14
addressbook.pb.go:36: AddressBook_Person_WORK redeclared in this block
        previous declaration at addressbook.pb.go:15
addressbook.pb.go:42: AddressBook_Person_PhoneType_name redeclared in this block
        previous declaration at addressbook.pb.go:21
addressbook.pb.go:47: AddressBook_Person_PhoneType_value redeclared in this 
block
        previous declaration at addressbook.pb.go:26
addressbook.pb.go:48: NewAddressBook_Person_PhoneType redeclared in this block
        previous declaration at addressbook.pb.go:27

What version of the product are you using? On what operating system?

$ pwd; hg identify
/Users/eclark/go/src/pkg/goprotobuf.googlecode.com/hg
3cf1c4f2acec tip

$ protoc --version
libprotoc 2.3.0

Please provide any additional information below.

Generated code works if message Person {} is defined outside of AddressBook.

Original issue reported on code.google.com by zer...@gmail.com on 26 Jun 2010 at 2:29

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by dsymo...@golang.org on 26 Jun 2010 at 7:33

GoogleCodeExporter commented 9 years ago
This issue was closed by revision e6691044ac.

Original comment by dsymo...@golang.org on 27 Jun 2010 at 12:33