We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6391f3d commit d93737dCopy full SHA for d93737d
vlib/v/gen/c/cgen.v
@@ -2748,6 +2748,7 @@ fn (mut g Gen) gen_assign_stmt(assign_stmt ast.AssignStmt) {
2748
g.expr(val)
2749
g.writeln(';}')
2750
}
2751
+ g.is_assign_lhs = false
2752
} else if assign_stmt.op == .assign
2753
&& (is_fixed_array_init || (right_sym.kind == .array_fixed && val is ast.Ident)) {
2754
mut v_var := ''
vlib/v/tests/map_get_assign_blank_test.v
@@ -0,0 +1,10 @@
1
+type Abc = int | string
2
+
3
+fn test_map_get_assign_blank() {
4
+ x := map[string]Abc{}
5
+ _ := x['nonexisting']
6
+ if y := x['nonexisting'] {
7
+ println(y)
8
+ }
9
+ assert true
10
+}
0 commit comments