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

cgen: fix wrong indent generation in anon fn decl (#17879)

This commit is contained in:
ChAoS_UnItY 2023-04-05 16:22:36 +08:00 committed by GitHub
parent d30e1a52e2
commit b2cf6d0af4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -379,6 +379,11 @@ fn (mut g Gen) gen_fn_decl(node &ast.FnDecl, skip bool) {
}
prev_inside_ternary := g.inside_ternary
g.inside_ternary = 0
prev_indent := g.indent
g.indent = 0
defer {
g.indent = prev_indent
}
g.stmts(node.stmts)
g.inside_ternary = prev_inside_ternary
if node.is_noreturn {