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

report one bug for enum in protoc-gen-lua script #27

Open
movebean opened this issue Aug 25, 2016 · 0 comments
Open

report one bug for enum in protoc-gen-lua script #27

movebean opened this issue Aug 25, 2016 · 0 comments

Comments

@movebean
Copy link

I report one bug for enum auto generate in protoc-gen-lua script.

proto file:
message RegisterReq {
enum CmdId
{
CMD_ID = 1;
}
optional ......
}

example:
module.REGISTERREQ_CMDID_CMD_ID_ENUM = protobuf.EnumValueDescriptor()
module.REGISTERREQ_CMDID_CMD_ID_ENUM.name = 'CMD_ID'
module.REGISTERREQ_CMDID_CMD_ID_ENUM.index = 0
module.REGISTERREQ_CMDID_CMD_ID_ENUM.number = 1
module.REGISTERREQ_CMDID.values = {REGISTERREQ_CMDID_CMD_ID_ENUM} // error
//should be
module.REGISTERREQ_CMDID.values = {module.REGISTERREQ_CMDID_CMD_ID_ENUM}

I am not very sure how to fix this gracefully

in protoc-gen-lua script 249 code_gen_enum_item function
I just change return value from
return obj_name
to
return 'module.' + obj_name

and It works

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