()
| 85 | pts: Point[2] = [Point { .x = 1, .y = 2 }, Point { .x = 3, .y = 4 }] |
| 86 | pts[1].x = 36 |
| 87 | first: Point* = &pts[0] |
| 88 | return pts[1].x + first.y |
| 89 | } |
| 90 | "#, |
| 91 | 38, |
| 92 | ); |
| 93 | } |
| 94 | |
| 95 | // --- Inferred binding syntax (`:=`) --- |
| 96 | |
| 97 | #[test] |
| 98 | fn inferred_bindings_execute() { |
| 99 | // `:=` infers primitive, array, and pointer types and runs end to end. |
| 100 | assert_exit( |
| 101 | r#" |
| 102 | main: () -> i32 { |
| 103 | n := 40 |
| 104 | arr := [1, 2] |
| 105 | p := &arr[1] |
| 106 | return n + @p |
| 107 | } |
| 108 | "#, |
nothing calls this directly
no test coverage detected