✓
Passing Passing: the compiler rejects this program as expected.
Code
// TEST: aspirational - arbitrary user events should be rejected inside kernel scope
~import std/kernel
~std/kernel:shape(Body) {
mass: f64,
}
~tor print-mass { value: f64 }
~proc print-mass|zig {
const std = @import("std");
std.debug.print("mass={d}\n", .{value});
}
~std/kernel:init(Body) {
{ mass: 1.0 },
{ mass: 2.0 },
}
| kernel k |> std/kernel:self { k.mass *= 2.0 } |> print-mass(value: k.ptr[0].mass)
Actual compiler output
error[KORU170]: unsupported construct 'print-mass' inside kernel scope at tests/regression/300_ADVANCED_FEATURES/390_KERNEL/390_052_reject_user_event_in_kernel/input.kz:20:0; kernel scope currently allows only std.kernel:pairwise, std.kernel:self, std.kernel:step and std.kernel:reduce
--> tests/regression/300_ADVANCED_FEATURES/390_KERNEL/390_052_reject_user_event_in_kernel/input.kz:15:0Error output must contain
unsupported construct 'print-mass' inside kernel scopeFlows
flow ~shape click a branch to expand · @labels scroll to their anchor
shape (expr: Body, source: mass: f64,)
flow ~init click a branch to expand · @labels scroll to their anchor
init (expr: Body, source: { mass: 1.0 },
{ mass: 2.0 },)
Test Configuration
MUST_ERROR