zig/test/incremental/make_decl_pub
mlugg 501e84a96a incremental: invalidate namespace dependencies when a name changes visibility
We could have more fine-grained dependencies here, but I think this is
fine for now.
2025-03-03 22:18:02 +00:00

25 lines
641 B
Text

#target=x86_64-linux-selfhosted
#target=x86_64-linux-cbe
#target=x86_64-windows-cbe
#target=wasm32-wasi-selfhosted
#update=initial version
#file=main.zig
const foo = @import("foo.zig");
pub fn main() !void {
try foo.hello();
}
#file=foo.zig
const std = @import("std");
fn hello() !void {
try std.io.getStdOut().writeAll("Hello, World!\n");
}
#expect_error=main.zig:3:12: error: 'hello' is not marked 'pub'
#expect_error=foo.zig:2:1: note: declared here
#update=make hello pub
#file=foo.zig
const std = @import("std");
pub fn hello() !void {
try std.io.getStdOut().writeAll("Hello, World!\n");
}
#expect_stdout="Hello, World!\n"