cgen: fix error in expr_with_cast

pull/4055/head
Joe Conigliaro 2020-03-18 20:42:56 +11:00
parent 54c38e3e3a
commit 5fc057d8ac
1 changed files with 2 additions and 1 deletions

View File

@ -357,7 +357,8 @@ fn (g mut Gen) expr_with_cast(got_type table.Type, exp_type table.Type, expr ast
got_idx := table.type_idx(got_type)
g.write('/* sum type cast */ ($exp_styp) {.obj = memdup(&(${got_styp}[]) {')
g.expr(expr)
g.writeln('}, sizeof($got_styp)), .typ = $got_idx};')
g.write('}, sizeof($got_styp)), .typ = $got_idx}')
return
}
}
}