v2 / vlib / v / tests / aliases / aliased_field_access_test.v
12 lines · 10 sloc · 181 bytes · 6488041a749df9762348d019c4223908c476f2e2
Raw
1struct Data {
2 field int
3}
4
5type AliasWithPtr = &Data
6
7fn test_aliased_field_access_test() {
8 data_with_ptr := AliasWithPtr(&Data{
9 field: 1
10 })
11 assert data_with_ptr.field == 1
12}
13