1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

cgen: fix error of reference struct str() (#12061)

This commit is contained in:
yuyi
2021-10-04 14:58:50 +08:00
committed by GitHub
parent a8c2c419cd
commit 03269f9854
2 changed files with 16 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
struct Example {
}
fn test_str_reference_struct() {
c1 := Example{}
println((&c1).str())
assert (&c1).str() == '&Example{}'
c2 := &Example{}
println(c2.str())
assert c2.str() == '&Example{}'
}