Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

checker: fix index expr that left is if expr (fix #22654) #22661

Merged
merged 4 commits into from
Oct 27, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion vlib/v/tests/indexexpr_with_if_expr_test.v
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
fn test_indexexpr_with_if_expr() {
mut array_a := [1, 2, 3]
mut array_b := [4, 5, 6]
(if true { array_a } else { array_b })[0] = 999
(if true {
array_a
} else {
array_b
})[0] = 999
spytheman marked this conversation as resolved.
Show resolved Hide resolved
println(array_a)
assert array_a == [999, 2, 3]
}
Loading