vfmt: fix `as var` in `match expr as var {}`

pull/5663/head
Delyan Angelov 2020-07-04 16:46:46 +03:00
parent fe50bdc164
commit b018381f10
1 changed files with 3 additions and 3 deletions

View File

@ -1304,9 +1304,9 @@ pub fn (mut f Fmt) match_expr(it ast.MatchExpr) {
} else if it.cond is ast.SelectorExpr {
// `x.y as z`
// if ident.name != it.var_name && it.var_name != '' {
if it.var_name != '' {
f.write(' as $it.var_name')
}
if it.var_name != '' && f.it_name != it.var_name {
f.write(' as $it.var_name')
}
f.writeln(' {')
f.indent++