From 0c7d73c8b02a9f4762203177e5c2858d44a06f38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kr=C3=BCger?= <45282134+UweKrueger@users.noreply.github.com> Date: Sun, 16 Aug 2020 23:01:49 +0200 Subject: [PATCH] sync/channels: use references for `chan mut X` testcase (#6145) --- vlib/sync/channel_array_mut_test.v | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/vlib/sync/channel_array_mut_test.v b/vlib/sync/channel_array_mut_test.v index 0527e61a66..679cf1b3e6 100644 --- a/vlib/sync/channel_array_mut_test.v +++ b/vlib/sync/channel_array_mut_test.v @@ -6,12 +6,16 @@ const ( struct St { mut: - n int + dummy i64 + dummy2 u32 + dummy3 i64 + n int + dummy4 int } // this function gets an array of channels for `St` references fn do_rec_calc_send(chs []chan mut St) { - mut s := St{} + mut s := &St(0) for { if !(&sync.Channel(chs[0])).pop(&s) { break @@ -24,7 +28,7 @@ fn do_rec_calc_send(chs []chan mut St) { fn test_channel_array_mut() { mut chs := [chan mut St{cap: 1}, chan mut St{}] go do_rec_calc_send(chs) - mut t := St{ + mut t := &St{ n: 100 } for _ in 0 .. num_iterations {