1
0
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:
Emily Hudson 2019-08-04 11:28:59 +00:00 committed by Alexander Medvednikov
parent 12dfd5f016
commit 59a4c923c4

View File

@ -3278,7 +3278,7 @@ fn (p mut Parser) js_decode() string {
for field in T.fields {
def_val := type_default(field.typ)
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)