()
| 68 | "#, |
| 69 | 42, |
| 70 | ); |
| 71 | } |
| 72 | |
| 73 | #[test] |
| 74 | fn array_of_struct_element_place() { |
| 75 | // Indexing an array of structs yields an element place; selecting a field |
| 76 | // and taking &arr[i] both work without `@arr[i]`. |
| 77 | assert_exit( |
| 78 | r#" |
| 79 | struct Point { |
| 80 | x: i32 |
| 81 | y: i32 |
| 82 | } |
| 83 | |
| 84 | main: () -> i32 { |
| 85 | pts: Point[2] = [Point { .x = 1, .y = 2 }, Point { .x = 3, .y = 4 }] |
| 86 | pts[1].x = 36 |
| 87 | first: Point* = &pts[0] |
nothing calls this directly
no test coverage detected