mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
parent
86694ddc85
commit
5d3795e876
@ -2925,6 +2925,9 @@ fn (mut g Gen) gen_assign_stmt(assign_stmt ast.AssignStmt) {
|
||||
g.right_is_opt = true
|
||||
}
|
||||
if blank_assign {
|
||||
if val is ast.IndexExpr {
|
||||
g.assign_op = .decl_assign
|
||||
}
|
||||
if is_call {
|
||||
old_is_void_expr_stmt := g.is_void_expr_stmt
|
||||
g.is_void_expr_stmt = true
|
||||
|
@ -1,6 +1,6 @@
|
||||
type Abc = int | string
|
||||
|
||||
fn test_map_get_assign_blank() {
|
||||
fn test_map_get_decl_assign_blank() {
|
||||
x := map[string]Abc{}
|
||||
_ := x['nonexisting']
|
||||
if y := x['nonexisting'] {
|
||||
@ -8,3 +8,12 @@ fn test_map_get_assign_blank() {
|
||||
}
|
||||
assert true
|
||||
}
|
||||
|
||||
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