Closed xfanhsl closed 6 years ago
对,暂时不支持default,后续会提供支持
这个功能挺重要的,我们也想要支持
好的,意见收到~目前的情况是proto2和3的default还不一样,支持还要写两份代码,而且影响性能Orz……准备最后不行的话还是用缓存元表的方法做算了……现在就看为了这个功能增加大概五百行代码是不是划算了……
可以考虑先支持proto3的default?
嗯,是打算一起支持的~proto3更简单一点儿~不过最近没时间写= =
已经支持默认值功能了
assert(protoc:load [[ message Phone { optional string name = 1; optional int64 phonenumber = 2[default=0]; } message Person { optional string name = 1; optional int32 age = 2; optional string address = 3; repeated Phone contacts = 4; } ]])
error: function[lfdfd] parameter start: value: table value: table value: table value: table value: table value: table string: [script/protoc.lua:998: bad argument #2 to '?' (string expected at fiel d 'default_value', got number)] ----parameter end----