starwing / lua-protobuf

A Lua module to work with Google protobuf
MIT License
1.75k stars 387 forks source link

sub.type_fallback #22

Closed chamzzzzzz closed 6 years ago

chamzzzzzz commented 6 years ago

sub.type_fallback中使用的字段self.import_fallback和文档描述(unknown_type)不一致

https://github.com/starwing/lua-protobuf/blob/acfaeddf6c3bdd89d1f5e69e88d415f589bb8d35/protoc.lua#L449

starwing commented 6 years ago

The unknwon_module and unknown_type handle could be true, string or a function. If set it to true, means all non-exists module or type are given a default value and do not trigger a error. If set it to a string, that string will be a Lua pattern that indicate whether a unknown module or type should produce a error, e.g.

p.unknown_type = "Foo.*"

这里不是提到了可以是string嘛?

chamzzzzzz commented 6 years ago

可能我表述不是很准确,我是指这里的代码之前使用的是self.import_fallback字段判断是否string,但是根据文档来看这里应该是用self. unknown_type。不过现在已经修复了。