mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
Fix for jsdecode struct initialisation
This commit is contained in:
parent
12dfd5f016
commit
59a4c923c4
@ -3278,7 +3278,7 @@ fn (p mut Parser) js_decode() string {
|
|||||||
for field in T.fields {
|
for field in T.fields {
|
||||||
def_val := type_default(field.typ)
|
def_val := type_default(field.typ)
|
||||||
if def_val != '' {
|
if def_val != '' {
|
||||||
decl += '$tmp . $field.name = $def_val;\n'
|
decl += '$tmp . $field.name = OPTION_CAST($field.typ) $def_val;\n'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
p.gen_json_for_type(T)
|
p.gen_json_for_type(T)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user