mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
parent
6391f3d2da
commit
d93737dd34
@ -2748,6 +2748,7 @@ fn (mut g Gen) gen_assign_stmt(assign_stmt ast.AssignStmt) {
|
||||
g.expr(val)
|
||||
g.writeln(';}')
|
||||
}
|
||||
g.is_assign_lhs = false
|
||||
} else if assign_stmt.op == .assign
|
||||
&& (is_fixed_array_init || (right_sym.kind == .array_fixed && val is ast.Ident)) {
|
||||
mut v_var := ''
|
||||
|
10
vlib/v/tests/map_get_assign_blank_test.v
Normal file
10
vlib/v/tests/map_get_assign_blank_test.v
Normal file
@ -0,0 +1,10 @@
|
||||
type Abc = int | string
|
||||
|
||||
fn test_map_get_assign_blank() {
|
||||
x := map[string]Abc{}
|
||||
_ := x['nonexisting']
|
||||
if y := x['nonexisting'] {
|
||||
println(y)
|
||||
}
|
||||
assert true
|
||||
}
|
Loading…
Reference in New Issue
Block a user