v2 / vlib / v / gen / c / testdata / struct_field_free.vv
15 lines · 13 sloc · 297 bytes · 70f466460f035d3d0421378cc5a2ee83c3161eef
Raw
1// Test, that the autogenerated `free` method compiles,
2// on a struct that has field names that are C/C++ keywords.
3
4struct Class {
5 class string
6 register string
7 namespace string
8 normal string
9}
10
11fn main() {
12 class := &Class{'abc', '123', '456', 'xyz'}
13 println(class)
14 class.free()
15}
16