feat(lua): specific error messages for type checking opts params

This commit is contained in:
bfredl
2023-08-01 23:35:34 +02:00
parent 7bc93e0e2f
commit 6c0812d92e
3 changed files with 11 additions and 8 deletions

View File

@@ -630,7 +630,7 @@ local function process_function(fn)
local seterr = ''
if string.match(param_type, '^KeyDict_') then
write_shifted_output(output, string.format([[
%s %s = { 0 }; nlua_pop_keydict(lstate, &%s, %s_get_field, %s&err);]], param_type, cparam, cparam, param_type, extra))
%s %s = { 0 }; nlua_pop_keydict(lstate, &%s, %s_get_field, &err_param, &err);]], param_type, cparam, cparam, param_type))
cparam = '&'..cparam
errshift = 1 -- free incomplete dict on error
else