module: do not expose list of modules

Doing so would encourage accidentally creating dependency loops.

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2024-04-05 14:10:10 -07:00 committed by Stephen Gutekanst
parent b4a479fb3f
commit 5dbf9ece3b
2 changed files with 20 additions and 20 deletions

View file

@ -24,7 +24,7 @@ pub const Engine = @import("engine.zig").Engine;
pub const ModSet = @import("module.zig").ModSet;
// TODO: perhaps this could be a comptime var rather than @import("root")?
const modules = blk: {
pub const modules = blk: {
if (!@hasDecl(@import("root"), "modules")) {
@compileError("expected `pub const modules = .{};` in root file");
}