| ... | @@ -3159,7 +3159,12 @@ test "linked list" { | ... | @@ -3159,7 +3159,12 @@ test "linked list" { |
| 3159 | .last = &node, | 3159 | .last = &node, |
| 3160 | .len = 1, | 3160 | .len = 1, |
| 3161 | }; | 3161 | }; |
| | 3162 | |
| | 3163 | // When using a pointer to a struct, fields can be accessed directly, |
| | 3164 | // without explicitly dereferencing the pointer. |
| | 3165 | // So you can do |
| 3162 | try expect(list2.first.?.data == 1234); | 3166 | try expect(list2.first.?.data == 1234); |
| | 3167 | // instead of try expect(list2.first.?.*.data == 1234); |
| 3163 | } | 3168 | } |
| 3164 | {#code_end#} | 3169 | {#code_end#} |
| 3165 | | 3170 | |