isphinx / protobuf-actionscript3

Automatically exported from code.google.com/p/protobuf-actionscript3
0 stars 0 forks source link

Having two messages with the same name will cause one to be over-written #5

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
message M1{message A{}}
message M2{message A{}}

What is the expected output? What do you see instead?
We should have two different classes of "A" instead we get one.

What version of the product are you using? On what operating system?
v2.1 on Windows Vista 32bit

Please provide any additional information below.
The Java version resolves this by nesting classes, but Actionscript does 
not allow this.

I see two different possibilities to resolve this:
1) Create a new folder per level of nesting (aka M1/A.as, M2/A.as)
2) Name "A" differently aka M1_A.as and M2_A.as

The C++ Version resolves this by Renaming M1.A to M1_A, so it is probably 
best to go with that solution for consistency.

"A message can be declared inside another message. For example: message Foo 
{ message Bar { } }
In this case, the compiler generates two classes: Foo and Foo_Bar"

Original issue reported on code.google.com by mcha...@gmail.com on 15 May 2009 at 1:00

GoogleCodeExporter commented 8 years ago
Good catch. The C++ solution (rename M1.A to M1_A) sounds the best and since 
it's
already implemented for the C++ side, it should be safe to port.

Any time to implement it? (I'm a bit swamped right now). Let me know.

Thanks,
Philippe.

Original comment by sorrydevil@gmail.com on 19 May 2009 at 6:00