✓
Passing This code compiles and runs correctly.
Code
// Test 156b: Directory import with non-public events (negative test)
//
// Tests that importing events WITHOUT ~pub markers fails at compile time
// This enforces proper API boundaries
const std = @import("std");
// Import directory 'lib/raylib' containing graphics.kz and audio.kz
// Events in these files are NOT marked ~pub, so this should fail
~import "$app/lib/raylib"
// Attempting to use non-public events should fail
~app.lib.raylib.graphics:render(width: 1920, height: 1080)
| drawn |> app.lib.raylib.graphics:clear(color: 0xFF0000)
| cleared |> app.lib.raylib.audio:play(sound_id: 42)
| playing |> app.lib.raylib.audio:stop()
| stopped |> _
Imported Files
// Audio module for raylib
const std = @import("std");
~event play { sound_id: i32 }
| playing {}
~event stop {}
| stopped {}
~proc play {
return .{ .@"playing" = .{} };
}
~proc stop {
return .{ .@"stopped" = .{} };
}
// Graphics module for raylib
const std = @import("std");
~event render { width: i32, height: i32 }
| drawn { pixels: i32 }
~event clear { color: i32 }
| cleared {}
~proc render {
return .{ .@"drawn" = .{ .pixels = width * height } };
}
~proc clear {
return .{ .@"cleared" = .{} };
}
Test Configuration
Expected Behavior:
FRONTEND_COMPILE_ERROR