Files
sx/issues/0019-import-non-transitive-c-scope.md
agra c21b683b08 docs(issues): mark 17 already-fixed issues RESOLVED with verified banners
Each banner was re-verified against the current binary (repro now behaves
correctly) and cites the actual fix location in current src/** plus the covering
regression example. Closes the stale-but-fixed backlog: 0019, 0042-0056, 0131.
No compiler change.
2026-06-21 09:25:52 +03:00

36 lines
1.9 KiB
Markdown

# 0019 — `#import` is non-transitive (C-function scope across files)
> **RESOLVED.** The `.md`'s own repro is non-runnable (relative `../modules/std.sx`
> imports) and superseded; the scenario — A importing B does NOT transitively expose
> a third module's top-level names — is enforced by the non-transitive `#import`
> visibility check in `lowerCall` (src/ir/lower/call.zig:106-118, gated on
> `isNameVisible`, defined in src/ir/lower/decl.zig:2502), with the const-reference
> path mirrored in src/ir/lower/expr.zig. Covered by the passing regression test
> `examples/0706-modules-import-non-transitive.sx`.
> **Status: superseded — kept for reference.** Relocated from the old
> `examples/issue-0019/` fixture during the test-layout migration. The behavior
> it probed (A imports B and C; C must NOT see B's `extern` C functions just
> because A imported B) is now covered by the passing test
> `examples/0706-modules-import-non-transitive.sx`.
## What it probed
`main` imports both `c_wrapper.sx` (which declares C `extern` functions) and
`other.sx`. `other.sx` should *not* gain access to `c_wrapper`'s C functions
transitively — using one should produce the "not visible; #import the module that
declares it" diagnostic.
- `main_good.sx` — the valid arrangement.
- `main_bad.sx` — the arrangement that must be rejected.
- `c_wrapper.sx`, `other.sx` — the imported modules.
## Caveat (why it doesn't run as-is)
The fixture uses **relative** imports (`#import "../modules/std.sx"`), which only
resolve relative to a specific working directory and violate the project's
"always `package:`/module-path imports, never relative" rule. It is not runnable
from the repo root and is not wired into the suite. If revived, rewrite the
imports to the standard `modules/...` form and pin expected output; otherwise it
can be deleted (the scenario is already covered by `0706-modules-import-non-transitive`).