build: close package variant identity gaps

This commit is contained in:
2026-08-12 22:09:55 +09:00
parent 1724ea086f
commit 2dd6b8a250
5 changed files with 57 additions and 7 deletions

View File

@@ -302,7 +302,7 @@ fn m2positive(pkg: str) void = {
};
testenv.writefile(strings.concat(td, "/consumer.ww"), strings.concat(
"package consumer;\nimport leaktest;\n",
"fn forbidden(s: leaktest.secret) void = {};\n"));
"fn forbidden(s: secret) void = {};\n"));
let ccav: []str = [testenv.driver("w6c"), "-c", "--import",
"leaktest", "cs.wwi", "-o", "cs.s", "consumer.ww"];
let wcav: []str = [testenv.driver("w6c_ww"), "-c", "--import",
@@ -314,8 +314,7 @@ fn m2positive(pkg: str) void = {
if (cco.termination != exec.termination.EXIT || cco.code == 0
|| wco.termination != exec.termination.EXIT || wco.code == 0
|| !testenv.same(cco.stderr, wco.stderr)
|| !testenv.has(cco.stderr,
"package 'leaktest' has no exported declaration 'secret'")) {
|| !testenv.has(cco.stderr, "unknown type 'secret'")) {
fail("private-closure", "private nominal became source-visible");
};
testenv.clean(td);