Both repros emit their target diagnostics cleanly today (verified 2026-05-28 against HEAD): - `issue-0033` → "no visible xx conversion from 's64' to 'Wrap' — impl exists in another module but is not imported". Catches the case where an `impl Into(X) for Y` is registered globally via one module's import chain but is NOT transitively imported by the file containing the `xx` site. - `issue-0034` → "duplicate xx conversion from 's64' to 'Wrap': impls in <a> and <b>". Catches two impls covering the same (Source, Target) pair both reachable from a single `xx` site. Renamed to focused feature names: - `issue-0033*` → `179-impl-visibility*` (4 files: main + impl + types + user). - `issue-0034*` → `180-impl-duplicate*` (4 files: main + impl-a + impl-b + types). Path references inside the files updated. Comment headers tightened to feature-focused (drop issue-NNNN provenance — that's in git history now). Expected `.txt` / `.exit` files captured against the full diagnostic text and exit code 1. The `issue-*` namespace in `examples/` now shrinks to the literal list of UNRESOLVED bug repros. 218/218.
22 lines
921 B
Plaintext
22 lines
921 B
Plaintext
// Impl visibility — an `impl Into(...) for ...` is registered into
|
|
// the global impl table when its module is imported anywhere in the
|
|
// program, but is only **visible** from files that themselves
|
|
// transitively import the impl's defining module.
|
|
//
|
|
// Setup:
|
|
// - 179-impl-visibility-impl.sx declares an `impl Into(Wrap) for s64`.
|
|
// - 179-impl-visibility-user.sx tries `xx 7 : Wrap` but only
|
|
// imports the shared types — NOT the impl module.
|
|
// - The xx at the user-file site must produce a "no visible xx
|
|
// conversion" diagnostic, not silently fall through to whatever
|
|
// was registered in another module.
|
|
//
|
|
// The diagnostic is the success criterion — the compile error is the
|
|
// expected output. Tests/expected/.txt captures it; .exit is 1.
|
|
|
|
#import "modules/std.sx";
|
|
#import "./179-impl-visibility-impl.sx";
|
|
#import "./179-impl-visibility-user.sx";
|
|
|
|
main :: () -> s32 { run_user(); }
|