()
| 106 | return n + @p |
| 107 | } |
| 108 | "#, |
| 109 | 42, |
| 110 | ); |
| 111 | } |
| 112 | |
| 113 | #[test] |
| 114 | fn inferred_struct_pointer_binding() { |
| 115 | // `:=` over new(T) infers T*; field access through it works. |
| 116 | assert_exit( |
| 117 | r#" |
| 118 | struct Box { |
| 119 | value: i32 |
| 120 | } |
| 121 | |
| 122 | main: () -> i32 { |
| 123 | b := new(Box) |
| 124 | b.value = 99 |
| 125 | return b.value |
| 126 | } |
| 127 | "#, |
| 128 | 99, |
| 129 | ); |
| 130 | } |
nothing calls this directly
no test coverage detected