Files
sx/issues/0019-import-non-transitive-c-scope.md
agra 34819f05de issues: relocate legacy examples/issue-* repros into issues/
Clear the examples/issue-* namespace (new layout keeps open-issue repros under
issues/, co-located with their .md). Two legacy files:

- issue-0030 was a feature-request placeholder (trivial main, no real test).
  `extern G : T;` cross-file sx globals are still unimplemented (parse error),
  so it's an open feature request: issues/0030-extern-global-declarations.{md,sx}.
- issue-0019 was a broken/superseded multi-file fixture (relative imports, not
  runnable from root; the non-transitive-#import scenario is covered by the
  passing 0706-modules-import-non-transitive). Moved to
  issues/0019-import-non-transitive-c-scope/ with a status note; safe to delete.

Suite unchanged: 324 passed.
2026-06-01 19:38:09 +03:00

1.3 KiB

0019 — #import is non-transitive (C-function scope across files)

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 #foreign 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 #foreign 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).