The Lua generator will generate incorrect code for this schema:
table Customer { name: string; age: int; } table Sale { amount: int; customer: Customer; } root_type Sale;
It should generate:
Sale.AddCustomer = function(builder, customer) builder:PrependUOffsetTRelativeSlot(1, customer, 0) end
But instead it generates:
function Sale.AddCustomer(builder, customer) builder:PrependStructSlot(1, customer, 0) end
This will cause an error when trying to encode a sale:
"Tried to write a Struct at an Offset that is different from the current Offset of the Builder."
See this file for schema and lua test code:
luatest.zip
This bug is in the current windows release and in the head of the repo, specifically this git hash:
#5822c1c8
The Lua generator will generate incorrect code for this schema:
table Customer { name: string; age: int; } table Sale { amount: int; customer: Customer; } root_type Sale;It should generate:
Sale.AddCustomer = function(builder, customer) builder:PrependUOffsetTRelativeSlot(1, customer, 0) endBut instead it generates:
function Sale.AddCustomer(builder, customer) builder:PrependStructSlot(1, customer, 0) endThis will cause an error when trying to encode a sale:
"Tried to write a Struct at an Offset that is different from the current Offset of the Builder."
See this file for schema and lua test code:
luatest.zip
This bug is in the current windows release and in the head of the repo, specifically this git hash:
#5822c1c8