File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -197,6 +197,7 @@ fn (mut g Gen) gen_assign_stmt(node ast.AssignStmt) {
197
197
if val is ast.IndexExpr {
198
198
g.assign_op = .decl_assign
199
199
}
200
+ g.is_assign_lhs = false
200
201
if is_call {
201
202
old_is_void_expr_stmt := g.is_void_expr_stmt
202
203
g.is_void_expr_stmt = true
@@ -209,7 +210,6 @@ fn (mut g Gen) gen_assign_stmt(node ast.AssignStmt) {
209
210
g.expr (val)
210
211
g.writeln (';}' )
211
212
}
212
- g.is_assign_lhs = false
213
213
} else if node.op == .assign
214
214
&& (is_fixed_array_init || (right_sym.kind == .array_fixed && val is ast.Ident )) {
215
215
mut v_var := ''
Original file line number Diff line number Diff line change @@ -17,3 +17,16 @@ fn test_map_get_assign_blank() {
17
17
}
18
18
assert true
19
19
}
20
+
21
+ fn get_value () int {
22
+ mut m := map [string ]int {}
23
+ _ := m['a' ] or { return 1 }
24
+ println ('a' )
25
+ return 0
26
+ }
27
+
28
+ fn test_map_get_assign_blank_with_or_expr () {
29
+ ret := get_value ()
30
+ println (ret)
31
+ assert ret == 1
32
+ }
You can’t perform that action at this time.
0 commit comments