-
Notifications
You must be signed in to change notification settings - Fork 92
Open
Description
I'm sorry, i'm not good at English.
For example:
// protobuf
message MyProto
{
required bool boolField = 1;
}-- lua codes
local p = MyProto()
p.boolField = false
print(p:HasField("boolField")) -- the result is: false
print(p:Serialize()) -- the result is: false, Missing require fieldThe false value of boolean type was not supported.
The following is source code of lua-pb/message.lua
function methods:HasField(name)
local data = rawget(self, '.data') -- field data.
return not not data[name]
endI think the code return not not data[name] may be replaced with return data[name] ~= nil. The same problem for Serialize and some other methods.
Metadata
Metadata
Assignees
Labels
No labels