tests: fix compilation of if_smartcast_test.v
parent
04ef2a2671
commit
d204c926a8
|
@ -18,8 +18,11 @@ fn test_mutable() {
|
||||||
mut x := Alphabet(Abc{'test'})
|
mut x := Alphabet(Abc{'test'})
|
||||||
if x is Abc {
|
if x is Abc {
|
||||||
y := Abc{}
|
y := Abc{}
|
||||||
x = &y
|
mut mx := x
|
||||||
assert x == &y
|
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() {
|
fn test_mutable_with_struct() {
|
||||||
mut x := Test{Abc{'test'}}
|
mut x := Test{Abc{'test'}}
|
||||||
if x.abc is Abc as test {
|
if x.abc is Abc as test {
|
||||||
test.val = 'test'
|
mut ttt := test
|
||||||
assert test.val == 'test'
|
assert u64(ttt) == u64(ttt)
|
||||||
|
ttt.val = 'test'
|
||||||
|
assert ttt.val == 'test'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue