mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03:00
fix: 1.set default value in gen_jsons when type is option not none;2.change default json.decode behavior for reduce ambiguity '{}' will be default type value and 'null' will be none value for option value
This commit is contained in:
parent
cf9bd20726
commit
70970e2d79
1 changed files with 0 additions and 1 deletions
|
@ -121,7 +121,6 @@ ${dec_fn_dec} {
|
|||
')
|
||||
|
||||
if utyp.has_flag(.option) {
|
||||
none_str := g.expr_string(ast.None{})
|
||||
dec.writeln('\tif (cJSON_IsNull(root)) {')
|
||||
dec.writeln('\t${result_name}_${ret_styp} ret;')
|
||||
dec.writeln('\t_result_ok(&res, (${result_name}*)&ret, sizeof(res));')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue