mirror of
https://github.com/vlang/v.git
synced 2025-09-23 20:37:03 -04:00
parent
106da40135
commit
afc710e024
@ -633,6 +633,11 @@ fn (mut w Walker) expr(node_ ast.Expr) {
|
||||
w.fn_decl(mut &ast.FnDecl(opmethod.source_fn))
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if !w.uses_append && node.op == .left_shift && (sym.kind == .array
|
||||
|| (sym.kind == .alias && w.table.final_sym(node.left_type).kind == .array)) {
|
||||
w.uses_append = true
|
||||
}
|
||||
}
|
||||
}
|
||||
right_type := if node.right_type == 0 && mut node.right is ast.TypeNode {
|
||||
@ -658,9 +663,6 @@ fn (mut w Walker) expr(node_ ast.Expr) {
|
||||
if !w.uses_eq && node.op in [.eq, .ne] {
|
||||
w.uses_eq = true
|
||||
}
|
||||
if !w.uses_append && node.op == .left_shift && !w.is_direct_array_access {
|
||||
w.uses_append = true
|
||||
}
|
||||
}
|
||||
ast.IfGuardExpr {
|
||||
w.expr(node.expr)
|
||||
|
7
vlib/v/tests/runes_test.v
Normal file
7
vlib/v/tests/runes_test.v
Normal file
@ -0,0 +1,7 @@
|
||||
module main
|
||||
|
||||
fn test_main() {
|
||||
s := 'hello'
|
||||
arr := s.runes()
|
||||
assert arr.len == 5
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user