| 1 | struct FnFields { |
| 2 | by_val fn (int) int = unsafe { nil } |
| 3 | by_ref fn (&int) int = unsafe { nil } |
| 4 | } |
| 5 | |
| 6 | fn by_val(n int) int { |
| 7 | return n + 1 |
| 8 | } |
| 9 | |
| 10 | fn by_ref(n &int) int { |
| 11 | return *n + 1 |
| 12 | } |
| 13 | |
| 14 | fn test_inline_fn_field_with_ref_param_type_does_not_collide() { |
| 15 | fields := FnFields{ |
| 16 | by_val: by_val |
| 17 | by_ref: by_ref |
| 18 | } |
| 19 | value := 41 |
| 20 | assert fields.by_val(41) == 42 |
| 21 | assert fields.by_ref(&value) == 42 |
| 22 | } |
| 23 |