mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
checker: check argument for chan.try_push/pop()
(#9798)
This commit is contained in:
@@ -18,7 +18,7 @@ fn do_rec(ch chan int, resch chan i64, n int) {
|
||||
mut sum := i64(0)
|
||||
for _ in 0 .. n {
|
||||
mut r := 0
|
||||
for ch.try_pop(r) != .success {
|
||||
for ch.try_pop(mut r) != .success {
|
||||
}
|
||||
sum += r
|
||||
}
|
||||
|
@@ -7,7 +7,7 @@ fn test_channel_try_buffered() {
|
||||
}
|
||||
}
|
||||
mut obj := int(0)
|
||||
for ch.try_pop(obj) == .success {
|
||||
for ch.try_pop(mut obj) == .success {
|
||||
println(obj)
|
||||
}
|
||||
assert obj == 6
|
||||
|
@@ -8,6 +8,6 @@ fn test_channel_try_unbuffered() {
|
||||
panic('push on non-ready channel not detected')
|
||||
}
|
||||
mut obj := -17
|
||||
for ch.try_pop(obj) == .success {}
|
||||
for ch.try_pop(mut obj) == .success {}
|
||||
assert obj == -17
|
||||
}
|
||||
|
Reference in New Issue
Block a user