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:
12
vlib/v/tests/str_reference_struct_test.v
Normal file
12
vlib/v/tests/str_reference_struct_test.v
Normal 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{}'
|
||||
}
|
||||
Reference in New Issue
Block a user