From d204c926a8fd83ac498d0cb3a8e59042e40de8d8 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Fri, 24 Jul 2020 10:30:22 +0300 Subject: [PATCH] tests: fix compilation of if_smartcast_test.v --- vlib/v/tests/if_smartcast_test.v | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/vlib/v/tests/if_smartcast_test.v b/vlib/v/tests/if_smartcast_test.v index 5c7ad1bc95..30db28e844 100644 --- a/vlib/v/tests/if_smartcast_test.v +++ b/vlib/v/tests/if_smartcast_test.v @@ -18,8 +18,11 @@ fn test_mutable() { mut x := Alphabet(Abc{'test'}) if x is Abc { y := Abc{} - x = &y - assert x == &y + mut mx := x + mx = &y + assert mx == &y + assert u64(mx) == u64(&y) + assert u64(x) != u64(&y) } } @@ -47,8 +50,10 @@ struct Test { fn test_mutable_with_struct() { mut x := Test{Abc{'test'}} if x.abc is Abc as test { - test.val = 'test' - assert test.val == 'test' + mut ttt := test + assert u64(ttt) == u64(ttt) + ttt.val = 'test' + assert ttt.val == 'test' } }