mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
parent
f45042fa09
commit
70de4e1009
@ -361,7 +361,7 @@ pub fn (mut c Checker) assign_stmt(mut node ast.AssignStmt) {
|
||||
node.pos)
|
||||
}
|
||||
}
|
||||
if left_sym.kind == .array && right_sym.kind == .array {
|
||||
if left_sym.kind == .array && right_sym.kind == .array && node.op == .assign {
|
||||
// `mut arr := [u8(1),2,3]`
|
||||
// `arr = [byte(4),5,6]`
|
||||
left_info := left_sym.info as ast.Array
|
||||
|
8
vlib/v/checker/tests/array_plus_assign_err.out
Normal file
8
vlib/v/checker/tests/array_plus_assign_err.out
Normal file
@ -0,0 +1,8 @@
|
||||
vlib/v/checker/tests/array_plus_assign_err.vv:1:5: warning: unused variable: `buffer`
|
||||
1 | mut buffer := []u8{cap: 1024}
|
||||
| ~~~~~~
|
||||
2 | buffer += "ipconfig && sudo apt-get install -y some_amazing_package name + command output".bytes()
|
||||
vlib/v/checker/tests/array_plus_assign_err.vv:2:1: error: operator `+=` not defined on left operand type `[]u8`
|
||||
1 | mut buffer := []u8{cap: 1024}
|
||||
2 | buffer += "ipconfig && sudo apt-get install -y some_amazing_package name + command output".bytes()
|
||||
| ~~~~~~
|
2
vlib/v/checker/tests/array_plus_assign_err.vv
Normal file
2
vlib/v/checker/tests/array_plus_assign_err.vv
Normal file
@ -0,0 +1,2 @@
|
||||
mut buffer := []u8{cap: 1024}
|
||||
buffer += "ipconfig && sudo apt-get install -y some_amazing_package name + command output".bytes()
|
Loading…
Reference in New Issue
Block a user