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

extend not working 'pb/standard.lua:357: table index is nil' #27

Open
niziak opened this issue Nov 15, 2016 · 0 comments
Open

extend not working 'pb/standard.lua:357: table index is nil' #27

niziak opened this issue Nov 15, 2016 · 0 comments

Comments

@niziak
Copy link

niziak commented Nov 15, 2016

When message extension is used, following error is printed:

luajit: /usr/local/share/lua/5.1/pb/standard.lua:357: table index is nil
stack traceback:
	/usr/local/share/lua/5.1/pb/standard.lua:357: in function 'define'
	/usr/local/share/lua/5.1/pb/standard.lua:219: in function 'define_types'
	/usr/local/share/lua/5.1/pb/standard.lua:253: in function 'define'
	/usr/local/share/lua/5.1/pb/standard.lua:219: in function 'define_types'
	/usr/local/share/lua/5.1/pb/standard.lua:373: in function 'compile'
	/usr/local/share/lua/5.1/pb.lua:182: in function 'load_proto'
	./test_extension.lua:20: in main chunk
	[C]: at 0x004043f0

Problem is in line 357 in pb/standard.lua: field.tag_type is nil. Table ket tag_type not exists.

Code to reproduce:

#!/usr/bin/env luajit

local proto = [[
message DeviceInfo {
  optional int32        deviceId             = 1;  
  optional int32        deviceType        = 2;
  
  extensions 100 to 199;   
}

message BatteryInfo {
  extend DeviceInfo {
    optional BatteryInfo batteryInfo = 100;
  }
  optional int32 addId = 1;
}
]]
  
local pb = require 'pb'
local Msgs = pb.load_proto(proto, "Message");
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