Fix for jsdecode struct initialisation

pull/1467/head
Emily Hudson 2019-08-04 11:28:59 +00:00 committed by Alexander Medvednikov
parent 12dfd5f016
commit 59a4c923c4
1 changed files with 1 additions and 1 deletions

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)