1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

cgen: fix error in expr_with_cast

This commit is contained in:
Joe Conigliaro 2020-03-18 20:42:56 +11:00
parent 54c38e3e3a
commit 5fc057d8ac

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) got_idx := table.type_idx(got_type)
g.write('/* sum type cast */ ($exp_styp) {.obj = memdup(&(${got_styp}[]) {') g.write('/* sum type cast */ ($exp_styp) {.obj = memdup(&(${got_styp}[]) {')
g.expr(expr) g.expr(expr)
g.writeln('}, sizeof($got_styp)), .typ = $got_idx};') g.write('}, sizeof($got_styp)), .typ = $got_idx}')
return
} }
} }
} }