✓
Passing This code compiles and runs correctly.
Code
// Test: Binding annotations in continuations
// Verifies parser accepts annotations on binding variables: | branch binding[annotation] |>
const std = @import("std");
~event get-data {}
| result i32
~proc get-data|zig {
return .{ .result = 42 };
}
// This event mutates the value it receives via a pointer
~event mutate-and-print { ptr: *i32 }
~proc mutate-and-print|zig {
ptr.* += 1; // Mutate the value
std.debug.print("Value: {d}\n", .{ptr.*});
}
// Test: Using [mutable] annotation so we can pass a mutable pointer
~get-data()
| result r[mutable] |> mutate-and-print(ptr: &r)
Actual
Value: 43
Expected output
Value: 43
Test Configuration
MUST_RUN